[Haskell-cafe] Type question re: map

R J rj248842 at hotmail.com
Fri Mar 6 22:39:46 EST 2009

Given the following (usual) definition of "map":

map                    :: (a -> b) -> [a] -> [b]
map f []               =  []
map f (x : xs)         =  f x : map f xs

What's the type of "map map"?

GHCi's :t command reveals:

*Main> :t map map
map map :: [a -> b] -> [[a] -> [b]]

I'd be grateful if anyone could provide a systematic type calculation so that I can reason through more complicated examples myself.


Windows Live™: Life without walls.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090307/2c7e9995/attachment.htm

More information about the Haskell-Cafe mailing list