Re: Overlapping instance declarations.

1997-12-10 Thread Alex Ferguson
Thanks Simon, you largely confirmed what I'd inferred. Pity there isn't such a clear description -- or really, any such description -- in the report! Cheers, Alex.

Contexts on data type definitions

1997-12-10 Thread John Hughes
Koen writes: Consider the following datatype declaration: data Eq a => Foo a = Foo a It introduces a new constructor function with the type: Foo :: Eq a => a -> Foo a So far so good. This is what we expect. It also introduces a new pattern, which will result in the following

Contexts in datatypes

1997-12-10 Thread Koen Claessen
Hello, Consider the following datatype declaration: data Eq a => Foo a = Foo a It introduces a new constructor function with the type: Foo :: Eq a => a -> Foo a So far so good. This is what we expect. It also introduces a new pattern, which will result in the following typing: unFoo :

Re: Overlapping instance declarations.

1997-12-10 Thread Simon L Peyton Jones
> "A type may not be declared as an instance of a particular class more than > once in the program." > > Doesn't it really mean that a type _constructor_ may not appear in more > than one instance declaration for a particular class? That (stronger) > condition seems to be what ghc and hugs impl