With these three declarations

  {-# LANGUAGE FlexibleInstances #-}
  {-# LANGUAGE UndecidableInstances #-}

  class C a where c :: a
  class C a => D a where d :: a
  instance C a => D a where d = c

ghci exhibits this behavior:

  *> :t d
  d :: (C a) => a

Where I would prefer "d :: (D a) => a". In my actual examples, the
context is much larger and I can't involve overlapping instances. Is
there a known workaround? I didn't find a related bug on the GHC trac,
and I don't know if other compilers behave in the same way.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to