|
|
Nicolas Alvarez wrote:
> I understand the C++ one and the Haskell one looks like line noise.
I just found this in the Haskell humour section:
bos: come on, real programmers use "(((,) <$>) .) . (<*>)"
(It's an IRC quote.)
I wish to point out that I had to actually go look up some of those
operators just to find out what they do!
(,) takes two values and returns a 2-element tuple.
<$> is a generalised version of "map" (not just for lists).
. is function composition, as always.
<*> takes a collection of functions and a collection of values and
applies one to the other.
So that little expression has the type signature
(Applicative col) => col (x -> y) -> col x -> col (z -> (y, z))
which more or less tells you what it does (once you realise that "col"
means "a collection of"). Quite why this particular function would be
useful for anything is another matter...
Post a reply to this message
|
|