[Haskell-cafe] MPTCs and rigid variables

David House dmhouse at gmail.com
Sat Mar 3 11:27:11 EST 2007


On 03/03/07, Bryan Burgers <bryan.burgers at gmail.com> wrote:
> As far as I know, you should be defining the type of bar in the class
> declaration for Foo, not in an instance declaration.

I think I over-reduced my problem. Here's a more complex issue that
can't be resolved by moving bar to be a method of the class:

{-# OPTIONS_GHC -fglasgow-exts #-}

class Foo a b | a -> b where
  foo :: Foo b c => a -> Maybe c

instance Foo String () where foo _ = Nothing
instance Foo Int String where foo 4 = Just (); foo _ = Nothing

-- 
-David House, dmhouse at gmail.com


More information about the Haskell-Cafe mailing list