[Haskell-beginners] map type explanation
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners