Guest User

Untitled

a guest
Feb 26th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. let rec take n = function
  2. | x :: xs when n > 0 -> x :: take (n - 1) xs
  3. | _ -> []
  4. let rec drop n = function
  5. | _ :: xs when n > 0 -> drop (n - 1) xs
  6. | xs -> xs
  7. let rec partition n step = function
  8. | [] -> []
  9. | xs -> take n xs :: partition n step (drop step xs)
Advertisement
Add Comment
Please, Sign In to add comment