[Haskell-cafe] Non-exported type classes?

Roberto Zunino zunino at di.unipi.it
Sat Mar 3 19:03:45 EST 2007


What is the effect of declaring a class in a module and not exporting
it? Would that prevent to add more instances to that class other than
those already defined in the module?

More in detail, consider this module:
===
module Peano (Z,S,C) where

data Z
data S a

-- Not exported
class Peano b where
instance Peano Z where
instance Peano a => Peano (S a) where

-- Exported
class Peano a => C a where
===

Would that limit the instances of the class C to the Peano type naturals?

Thanks,
Roberto Zunino.


More information about the Haskell-Cafe mailing list