RE: forall and class contexts

2002-10-16 Thread Wolfgang Jeltsch
On Wednesday, 2002-10-16, 10:07, CEST, Ashley Yakeley wrote: > [...] > > > Presumably you mean 'instance' not 'class'? A class decl always has > > a type variable after the =>; thus ...=> C a. > > Unless Wolfgang meant > > class (Eq (forall a. t a), Monad t) => C t This is exactly what I me

RE: forall and class contexts

2002-10-16 Thread Wolfgang Jeltsch
On Wednesday, 2002-10-16, 09:40, CEST, Simon Peyton-Jones wrote: > > I want to define something like > > class (Eq (forall a. T a), Monad T) => C T > > where the context shall mean that T has to be an instance of Monad > > and > > that for every type a the type T a has to be an instance of Eq.

RE: forall and class contexts

2002-10-16 Thread Hal Daume III
> > class (Eq (forall a. t a), Monad t) => C t > > more logically, > > class (forall a. Eq (t a), Monad t) => C t and more usefully, class (forall a . Eq a => Eq (t a), Monad t) => C t - Hal ___ Haskell mailing list [EMAIL PROTECTED] http://w

RE: forall and class contexts

2002-10-16 Thread Ashley Yakeley
At 2002-10-16 01:07, Ashley Yakeley wrote: > class (Eq (forall a. t a), Monad t) => C t more logically, class (forall a. Eq (t a), Monad t) => C t -- Ashley Yakeley, Seattle WA ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/m

RE: forall and class contexts

2002-10-16 Thread Ashley Yakeley
At 2002-10-16 00:40, Simon Peyton-Jones wrote: >Not currently, but I think it makes sense, and I'll implement it if >enough people ask. That's two. FWIW, my pint offer still stands. >Presumably you mean 'instance' not 'class'? A class decl always has a >type variable after the =>; thus ...=> C

Re: forall and class contexts

2002-10-16 Thread Andrew J Bromage
G'day all. On Wed, Oct 16, 2002 at 08:40:18AM +0100, Simon Peyton-Jones wrote: > There aren't many type constructors T for which T a is an equality > type... I can think of a few, like IORef. Admittedly I can't think of any that are also monads. Cheers, Andrew Bromage

RE: forall and class contexts

2002-10-16 Thread Simon Peyton-Jones
| I want to define something like | class (Eq (forall a. T a), Monad T) => C T | where the context shall mean that T has to be an instance of Monad and | that for every type a the type T a has to be an instance of Eq. | Is such a thing possible with some Haskell implementation? Not currently,