foralls in class assertions

Ashley Yakeley ashley@semantic.org
Thu, 18 Jul 2002 19:23:30 -0700


At 2002-02-20 13:15, Simon Peyton-Jones wrote:

>OK, so it does look as though it's the same idea as 
>that described in our paper.   Good.
>
>I have not implemented, yet.  

I don't suppose you did for GHC 5.04?...

>As always my implementation
>priorities are strongly influenced by my perception of whether
>some enhancement would be used.  Maybe you can outline
>why such a change would be useful to you?  I only have the
>example in our paper as motivation so far.

I just thought of another motivating example for this:

  class Monoid a where
    mempty :: a
    mappend :: a -> a -> a
    mconcat :: [a] -> a

  class (
    Monad m,
    forall a. Monoid m a
    ) => MonadPlus m

Of course, you folks might not want to rewrite Control.Monad.MonadPlus. 
But I think is shows this sort of thing is useful in principle (and it 
would great for my HBase, which does its own Prelude).

-- 
Ashley Yakeley, Seattle WA