2005-04-24 08:51:33 +00:00
|
|
|
{-# OPTIONS -cpp #-}
|
|
|
|
|
|
|
|
module API where
|
|
|
|
|
2010-09-22 05:10:19 +00:00
|
|
|
import Data.Typeable
|
2005-04-24 08:51:33 +00:00
|
|
|
|
|
|
|
data Interface = Interface {
|
|
|
|
equals :: forall t. Eq t => t -> t -> Bool
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
|
|
|
-- see how it hides the internal type.. but to compile GHC still checks
|
|
|
|
-- the type.
|
|
|
|
--
|
|
|
|
instance Typeable Interface where
|
|
|
|
#if __GLASGOW_HASKELL__ >= 603
|
|
|
|
typeOf i = mkTyConApp (mkTyCon "API.Interface") []
|
|
|
|
#else
|
|
|
|
typeOf i = mkAppTy (mkTyCon "API.Interface") []
|
|
|
|
#endif
|
|
|
|
|
|
|
|
plugin :: Interface
|
|
|
|
plugin = Interface { equals = (==) }
|
|
|
|
|