
On Mon 16.02 15:28, Markus Barenhoff wrote:
Good Afternoon,
i'am trying to express something like this here:
-- CI.hs http://pastebin.com/f5b17cf57 {-# OPTIONS -XMultiParamTypeClasses #-}
module CI(D,f) where
class B b
class (B b) => A a b where f :: b
data D = D
instance B D
instance A D D where f = D -- CI.hs
-- MultiClassTest.hs http://pastebin.com/f1c481e8d import CI
a = f -- MultiClassTest.hs
I forgot to mention that constrain a :: D does leed to the same ghc messages.
ghc output: MultiClassTest.hs:4:4: No instance for (CI.A a D) arising from a use of `f' at MultiClassTest.hs:4:4 Possible fix: add an instance declaration for (CI.A a D) In the expression: f In the definition of `a': a = f Failed, modules loaded: CI.
Markus