[Haskell-cafe] closed classes
Malcolm.Wallace at cs.york.ac.uk
Fri Aug 6 10:44:13 EDT 2004
Ketil Malde <ketil+haskell at ii.uib.no> writes:
> Duncan Coutts <duncan.coutts at worcester.oxford.ac.uk> writes:
> > closed class GConfValue v where
> module Closed(foo) where
> class C a where foo = ...
> instance C ...
> module Main where
> import Closed
> do what you want? You can only use existing instances of C, but not
> declare them (outside of the Closed module), IIUC.
Ah, but now you cannot use (Closed t) => as a predicate in type
signatures, and since you cannot write a partial signature, you must
omit the signature altogether...
More information about the Haskell-Cafe