[Haskell-cafe] Re: TypeFamillies and UndecidableInstances - why?
Maciej Piechotka
uzytkownik2 at gmail.com
Tue Jun 22 22:01:18 EDT 2010
On Tue, 2010-06-22 at 21:51 -0400, Brandon S. Allbery KF8NH wrote:
> On Jun 22, 2010, at 21:41 , Maciej Piechotka wrote:
> > test.hs:11:0:
> > Constraint is no smaller than the instance head
> > in the constraint: Functor (TestMonad a)
> > (Use -XUndecidableInstances to permit this)
> > In the instance declaration for `Functor (Testable a)'
> >
> > What is undecidable? a is bound so TestMonad a should be bound so
> > Functor (TestMonad a) should be valid.
>
> I *think* the point of the error message is that Functor (TestMonad a) is a tautology, so including it doesn't actually constrain the instance (which in GHC-ese is "Constraint is no smaller than the instance head"). In short, GHC thinks you're being tricky in a way it can't understand, because otherwise there's no point in including the constraint, so it's telling you that being tricky requires UndecidableInstances.
>
I'm sorry but how "Functor (TestMonad a) is a tautology"? It cannot be
derived from other constraints (in and outside this class).
Unless you mean that GHC thinks it is tautology.
Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100622/b4b12ed8/attachment.bin
More information about the Haskell-Cafe
mailing list