Skip to content

Instantly share code, notes, and snippets.

@solidsnack
Created October 16, 2013 19:25
Show Gist options
  • Select an option

  • Save solidsnack/7013348 to your computer and use it in GitHub Desktop.

Select an option

Save solidsnack/7013348 to your computer and use it in GitHub Desktop.

Haskell example:

powerset :: (Eq t) => [t] -> [[t]]
powerset [   ] = []
powerset [ h ] = [ [h] ]
powerset (h:t) = map (h:) sub ++ sub
 where sub = powerset t

C example:

int** powerset(int* items) {
  // ??
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment