Skip to content

Instantly share code, notes, and snippets.

@kunishi
Created January 29, 2014 10:19
Show Gist options
  • Select an option

  • Save kunishi/8685153 to your computer and use it in GitHub Desktop.

Select an option

Save kunishi/8685153 to your computer and use it in GitHub Desktop.
fun partition(p, nil) = (nil, nil)
| partition(p, x::xs) =
let
val (ys, zs) = partition(p, xs)
in
if p(x) then (x::ys, zs)
else (ys, x::zs)
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment