Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save kunishi/8685163 to your computer and use it in GitHub Desktop.
fun consset(a, nil) = nil
| consset(a, x::xs) = (a::x)::consset(a, xs);
fun powerset(nil) = [nil]
| powerset(x::xs) =
let
val p = powerset(xs)
in
p@consset(x, p)
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment