When I tried to do something like:

> {-# LANGUAGE FlexibleContexts #-}
> {-# LANGUAGE TypeFamilies #-}
> 
> class Test a where
>       type TestMonad a :: * -> *
>       from :: a b -> TestMonad a b
>       to :: TestMonad a b -> a b
> 
> data Testable a b = Testable (a b)
> 
> instance (Test a, Functor (TestMonad a)) => Functor (Testable a) where
>       f `fmap` Testable v = Testable $! (to . fmap f . from) v
> 

It asks for adding UndecidableInstances as:

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.

Is it a bug/missing feature in ghc or do I fail to see something?

Regards

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to