
Am Donnerstag, 18. April 2002 14:12 schrieb Simon Marlow:
Ralf Hinze
writes: BTW, does this version support rank-n types?
IIRC the previous snapshot did. So presumably this one does too?
Yes, it does.
Simon
That's what I feared ;-). Ok, here is my first attempt at defining a rank-3 function (code attached). ghci responds --- ralf/Haskell> ghci -v -fglasgow-exts Rank3.lhs ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.03.20020410, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Glasgow Haskell Compiler, Version 5.03.20020410, for Haskell 98, compiled by GHC version 5.03.20020410 <...> *** Typechecker: Rank3.lhs:20: Illegal polymorphic type: forall b1 b2. (b1 -> b2) -> h1 f1 b1 -> h2 f2 b2 In the type: forall h1 h2 a1 a2. (forall f1 f2. (forall c1 c2. (c1 -> c2) -> f1 c1 -> f2 c2) -> forall b1 b2. (b1 -> b2) -> h1 f1 b1 -> h2 f2 b2) -> (a1 -> a2) -> HFix h1 a1 -> HFix h2 a2 While checking the type signature for `mapHFix' --- Do I have to hoist the forall quantifiers in bla -> forall a . blub myself? At least, the code typechecks then. Cheers, Ralf