[Haskell-cafe] A very nontrivial parser

Bulat Ziganshin bulat.ziganshin at gmail.com
Sun Jul 8 10:51:10 EDT 2007


Hello Andrew,

Sunday, July 8, 2007, 4:31:32 PM, you wrote:
> Oh, I don't mind not knowing how rank-2 types are *implemented*. ;-) But
> it would be nice to know what they *are*... :-S

concrete types are rank-0:

sin :: Double->Double

polymorphic types are rank-1:

length :: forall a . [a] -> Int

functions which arguments are rank-1 types are rank-2:

f :: (forall a . [a] -> Int) -> Int

and so on. rank-2 and rank-N considered separately because it's easier
to implement only rank-2 polymorphism and some compilers stops here
(and rank-2 polymorphism used in ST monad which is pretty standard
feature, while higher-rank functions are rarely required)


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list