Another Implicit Parameter Infelicity
Simon Peyton-Jones
simonpj@microsoft.com
Mon, 4 Feb 2002 02:01:38 -0800
| p :: Maybe ((?param :: a) =3D> a)
| p =3D return g;
Neither GHC nor Hugs allow a polymorphic type variable
(the argument of Maybe) to be instantiated to a polymorphic
type. Systems which do are called 'impredicative' (or is it the
other way around?). Going impredicative has big negative=20
implications for type inference, and I have always steered well clear!
| Not only that, but they both complain about this:
|=20
| q :: b -> ((?param :: a) =3D> a)
|=20
| ...even though it can only mean this:
|=20
| q :: (?param :: a) =3D> b -> a
Hmm. GHC is supposed to "hoist" for-alls that occur at the right
hand end of function arrows (yet another non-std extension),
but it obviously isn't quite working right. I'll look into that.=20
Simon