I have a function \'subsets\' which generate all the subsets of a given set:
subsets :: [Int] -> [[Int]] subsets [] = [[]] subsets (x:xs) = subsets xs ++
The idea is that you want to take all subsets and then only keep the ones that sum 0
sum
subsetsSum0 ls = filter (\ss -> (sum ss) == 0) (subsets ls)
let's make this code point-free
subsetsSum0 = filter ((==0) . sum) . subsets