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.
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
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 :
> "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