[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Restrictions on associated types for classes

Subject: Re: [Haskell-cafe] Restrictions on associated types for classes
From: Conor McBride
Date: Thu, 17 Dec 2009 17:22:03 +0000
On 17 Dec 2009, at 15:31, Simon Peyton-Jones wrote:

Hmm.  If you have
  class (Diff (D f)) => Diff f where

then if I have
        f :: Diff f => ...
        f = e
then the constraints available for discharging constraints arising from e are
        Diff f
        Diff (D f)
        Diff (D (D f))
        Diff (D (D (D f)))
        ...

That's a lot of constraints.
But isn't it a bit like having an instance

  Diff f => Diff (D f)

?

Conor
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>