[Haskell-beginners] map type explanation

Lawrence Bottorff borgauf at gmail.com
Fri Dec 18 18:30:54 UTC 2020


I'm looking at this

ghci> :type map
map :: (a -> b) -> [a] -> [b]

and wondering what the (a -> b) part is about. map takes a function and
applies it to an incoming list. Good. Understood. I'm guessing that the
whole Haskell type declaration idea is based on currying, and I do
understand how the (a -> b) part "takes" an incoming list, [a] and produces
the [b] output. Also, I don't understand a and b very well either.
Typically, a is just a generic variable, then b is another generic variable
not necessarily the same as a. But how are they being used in this type
declaration?

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20201218/4f066558/attachment.html>


More information about the Beginners mailing list