On Fri, Oct 10, 2008 at 10:56 AM, Jonathan Cast
<jonathanccast@fastmail.fm> wrote:
On Fri, 2008-10-10 at 10:59 -0700, Daryoush Mehrtash wrote:
> I was in fact trying to figure out how "guard" worked in the "do".
> The interesting (for a beginner) insight is that:
>
> [()] map f = [f]
I don't think any clarity is added by made-up notation. I think you
mean
map f [()] = [f ()]
or
[()] >>= f = f ()
or
[()] >> f = f
or
do
[()]
f
= f
or
[ f | _ <- [()] ] = [ f ]
> --( just as any list with one element would have been such
> as [1] map f = [f] ) where as
>
> [] map f = []
And
map f [] = []
or
[] >>= f = []
or
[] >> f = []
or
do
[]
f
= []
or
[ f | _ <- [] ] = []
jcc