Another Implicit Parameter Infelicity

Ashley Yakeley
Mon, 4 Feb 2002 13:13:56 -0800

At 2002-02-04 02:01, Simon Peyton-Jones wrote:

>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 
>implications for type inference, and I have always steered well clear!

That's not what's happening here with implicit parameters, is it? No type 
variable is being instantiated.

I'm pretty sure this does not need impredicativeness:

     p :: forall a. Maybe ((?param :: a) => a)
     p = return g;

It's more or less equivalent to this:

     p :: forall a. Maybe (a -> a)
     p = return g;

...and not to be confused with this:

     p :: Maybe (forall a. a -> a)
     p = return g;

Or am I misunderstanding something?

Ashley Yakeley, Seattle WA