Mark P Jones wrote:
> 
> | Ok thanks.  It would also be nice to allow forall in instance
> | declarations so that the following would be possible.
> |
> | import ST
> |
> | class Run s c where
> |     run :: s c -> c
> |
> | instance Run (forall s. ST s) c where
> |     run a = runST a
> 
> First of all, the scoping here is wrong.  This example is nonsense
> because  (forall s. ST s) c  isn't the same as  (forall s. ST s c).
> 

Your right.  Is was not well thought out 

> Secondly, this example puts forall's into a completely new context,
> and I'm not sure we know how to make unification work when with
> such types.  That, after all, is why we have to give forall's a
> special case treatment to begin with.  Much better, it seems to
> me, to write:
> 
>   newtype Runnable a = Runnable (forall s. ST s a)
> 
> and then define:
> 
>   instance Run Runnable a where run (Runnable p) = runST p
> 
> I'm not sure you even want a two parameter class for Run here.

Ok your example is better except that the runnable constructor must be
used.  Are they any planes to adding implicate type  conversion rules to
Haskell?

-- 
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/

Reply via email to