[Haskell-beginners] fmap composition

Marco Turchetto marco.turchetto.mt at gmail.com
Tue Jun 12 16:12:05 UTC 2018


I'm reading the "Haskell programming" book and in chapter 16 about functors
they combine two "fmap" with the "(.)" function.
I really don't understand how the type of "fmap . fmap" is "(Functor f2,
Functor f1) => (a -> b) -> f1 (f2 a) -> f1 (f2 b)".

The thing that really freaks me out is that I thought that "(.)" arguments
are ONLY two unary function.
Maybe there is some curring magic underline, there is someone that can
explain to me how the type of "fmap . fmap" is derived from the type of
"fmap" and "(.)"?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20180612/77607a47/attachment.html>


More information about the Beginners mailing list