instance inference

Ross Paterson ross at
Mon Dec 12 05:45:57 EST 2005

I'm puzzled that the following is accepted.  Is some sort of greatest
fixed point computation used for instances?

{-# OPTIONS_GHC -fglasgow-exts #-}
module M where

class C a b where c :: a -> b -> Bool

instance C b b => C (Maybe a) b where c x y = c y y

f :: Maybe a -> Bool
f x = c x x

More information about the Glasgow-haskell-users mailing list