[Haskell-cafe] Powerset of a set

Francesco Ariis fa-ml at ariis.it
Mon Sep 14 19:18:55 UTC 2015


On Mon, Sep 14, 2015 at 01:57:10PM -0500, JORGE MALDONADO wrote:
> The powerset of set s is a set containing all subsets of s.
> I need a clue on how to write Haskell code to get the superset of a set
> using direct recursion and list comprehension.
> 
> Best regads.

This is good for haskell-beginners rather than haskell cafe.

Clue:
    - say you have a list `l` [a,b,c,d,e]
    - you have the powerset of list `m` [b,c,d,e]
    - how can you use the `powerset of m` to calculate the `powerset of l`?


More information about the Haskell-Cafe mailing list