We use lists to represent sets. Your task is to define a function, subsets
, that receives a list as a set and returns the set of all subsets of the input set. For example:
subsets :: [Int] -> [[Int]]
subsets [] = [ [] ]
>subsets [1,2,3] = [ [], [1], [2], [3],[1,2] [1,3], [2,3], [1,2,3] ] –順序無關