Skip to content

Instantly share code, notes, and snippets.

@voter101
Created October 21, 2015 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voter101/12243abdaa3db9d8bdc5 to your computer and use it in GitHub Desktop.
Save voter101/12243abdaa3db9d8bdc5 to your computer and use it in GitHub Desktop.
let rec prefixes l = match l with
[] -> []
| x::xs -> [x] :: (List.map (fun a -> (x :: a)) (prefixes xs));;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment