Another Implicit Parameter Infelicity

Simon Peyton-Jones simonpj@microsoft.com
Tue, 5 Feb 2002 06:42:34 -0800


GHC treats implicit parameters as a type
scheme, not a type.  As it happens, John Hughes's message
to the list today discusses exactly this point.

Simon

| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]=20
| Sent: 04 February 2002 21:14
| To: Simon Peyton-Jones; Haskell List
| Subject: RE: Another Implicit Parameter Infelicity
|=20
|=20
| At 2002-02-04 02:01, Simon Peyton-Jones wrote:
|=20
| >Neither GHC nor Hugs allow a polymorphic type variable
| >(the argument of Maybe) to be instantiated to a polymorphic type. =20
| >Systems which do are called 'impredicative' (or is it the other way=20
| >around?).  Going impredicative has big negative implications=20
| for type=20
| >inference, and I have always steered well clear!
|=20
| That's not what's happening here with implicit parameters, is=20
| it? No type=20
| variable is being instantiated.
|=20
| I'm pretty sure this does not need impredicativeness:
|=20
|      p :: forall a. Maybe ((?param :: a) =3D> a)
|      p =3D return g;
|=20
| It's more or less equivalent to this:
|=20
|      p :: forall a. Maybe (a -> a)
|      p =3D return g;
|=20
| ...and not to be confused with this:
|=20
|      p :: Maybe (forall a. a -> a)
|      p =3D return g;
|=20
| Or am I misunderstanding something?
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
|=20