[Haskell-cafe] A function that makes list of Bool lists from list
of Int lists
mauro19838 at gmail.com
Sat Apr 3 11:34:21 EDT 2010
The last part I cant understand:
So I give it for example
zipWith ($) (map (\x -> map (const x)) (cycle [True, False])) [[1,2],]
Okay, because of ($) it takes the first element of the last part which is
[1,2] and apply the function on it
But how makes this: map (\x -> map (const x)) (cycle [True, False])
[True,True] from [1,2]?
Then he takes  but how makes [False] from that?
It easily can be that my functional programming knowledge isn't enough to
understand this and maybe I misunderstood it already. But I hope I'll be
able to do so..
On Sat, Apr 3, 2010 at 4:31 PM, Edward Z. Yang <ezyang at mit.edu> wrote:
> Excerpts from Maur Toter's message of Sat Apr 03 10:29:34 -0400 2010:
> > What does the ($) at zipWith?
> ($) is function application
> Prelude> :t ($)
> ($) :: (a -> b) -> a -> b
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe