> Date: Sun, 13 Jun 1999 01:51:06 -0400
> From: Kevin Atkinson <[EMAIL PROTECTED]>

> Could some one explain to me why [this is not OK]:

>   class T f r
> 
>   instance T a       (d a)
>   instance T (c a b) (c a (d b))

Because, just as Hugs says:

>   *** Common instance : T (a b c) (a b (a b c))

given

        data Foo a b = Foo a b

the type

        T (Foo Int Char) (Foo Int (Foo Int Char))

will match both instance declarations --- the first one with

        a = (Foo Int Char)
        d = (Foo Int)

the second one with

        c = Foo
        a = Int
        b = Char
        d = (Foo Int)

Lars Mathiesen (U of Copenhagen CS Dep) <[EMAIL PROTECTED]> (Humour NOT marked)


Reply via email to