Hi,
I am learning Haskell using the Haskell Programming from 1st Principles book.
And I can’t read/decode the following expression:
(fmap . fmap) sum Just [1, 2, 3]
whose value is Just 6
.
I mean, I tried to massage it in some ways (parenthesize, partially apply…) to see if I understand how it is evaluated but I just can’t!
Can’t even get the number of arguments for sure: 2 ? 3 ? Something else…
Obviously, I can get the same result with:
fmap sum (Just [1, 2, 3])
fmap sum $ Just [1, 2, 3]
But I can’t make sense of the first expression (grrrr…), Please somebody help me!
Thanks
B