On Jul 17, 2009 1:40pm, Thomas Hartman wrote:
> my question to all 3 (so far) respondants is, how does your
>
> explanation explain that the result is the power set?
>
>

I guess you forgot to reply to the cafe.

Well, to me the modified definition I posted looks like the essence of powerset, the set of all subsets. Every element x of the input list divides the powerset in 2 halves, the first one contains x, the second one doesn't. Filtering on the non-deterministic predicate (\x -> return True `mplus` return False) in the List monad does exactly that.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to