Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec take n = function
- | x :: xs when n > 0 -> x :: take (n - 1) xs
- | _ -> []
- let rec drop n = function
- | _ :: xs when n > 0 -> drop (n - 1) xs
- | xs -> xs
- let rec partition n step = function
- | [] -> []
- | xs -> take n xs :: partition n step (drop step xs)
Advertisement
Add Comment
Please, Sign In to add comment