Created
February 22, 2010 14:21
-
-
Save camilopayan/311102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment