{-# LANGUAGE TypeFamilies #-} module Test where class A a where type R a :: * f :: a -> R a class C a where g :: a -> b instance A Int where type R Int = C a => a f = undefined#
ghci> :l Test.hs [1 of 1] Compiling Test ( Test.hs, interpreted ) Test.hs:12:3: Illegal polymorphic or qualified type: forall a. C a => a In the type synonym instance declaration for `R' In the instance declaration for `A Int' Failed, modules loaded: none.#