Skip to content

Instantly share code, notes, and snippets.

let rec separate = function
| [] -> ([],[])
| []::xs -> ([],[])
| (x::xs)::ys -> let (M,N) = separate ys
(x::M, xs::N)
let rec trans = function
| [] -> []
| x::xs -> let (q, w) = separate (x::xs) in
if List.length(q) = 0 then [] else [q] @ trans w