[Haskell-cafe] principle types

Paul Johnson paul at cogito.org.uk
Wed Mar 14 12:07:11 EDT 2007


Vikrant wrote:
>
> (map map)::[a -> b] -> [[a] -> [b]]
>
> I am able to interpret the expressions "[a -> b] -> [[a] -> [b]]"  
> vaguely...
>
> does this mean that 'map map' takes list of functions of type (a->b) 
> and returns list of functions of type ([a]->[b])
> if yes ..how do I derive it from basic type declaration of map?
Think substitution.  It helps if you distinguish the letters.  Start by 
saying that one of the maps has type (c -> d) -> [c] -> [d].  Then 
substitute a =(c->d), b=[c] (I think it would be).

Paul.



More information about the Haskell-Cafe mailing list