2009/7/17 Gleb Alexeyev :
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?
Because powerset(s) = 2^s?
I was going to make some nice code but I ended up with this monster :D
{-#
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
Thomas Hartman wrote:
on haskell reddit today
powerSet = filterM (const [True, False])
Does it help if we inline the 'const' function and rewrite [True, False]
in monadic notation as (return True `mplus` return False)?
powerSet = filterM (\x -> return True `mplus` return False).
You can s