Skip to content

Instantly share code, notes, and snippets.

@ldfallas
Created October 5, 2009 03:25
Show Gist options
  • Save ldfallas/201840 to your computer and use it in GitHub Desktop.
Save ldfallas/201840 to your computer and use it in GitHub Desktop.
let rec MultiPartition aList (p:'a -> 'a -> bool) results =
match aList with
| x::rest ->
let equivalent,newRest =
List.partition
(fun e -> p x e)
rest
in MultiPartition newRest p ((x::equivalent)::results)
| [] -> results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment