[Haskell-cafe] closed classes [was: Re: exceptions vs. Either]

MR K P SCHUPKE k.schupke at imperial.ac.uk
Thu Aug 12 09:02:46 EDT 2004


Okay anybody whish to argue against these points:

	1) closed or open is the same if no instances overlap

	2) overlapping instances (open or closed) can break
	   code in modules which import the defining module
	   if a new instance is declared in any imported
	   module.

	3) code changes in non-imported modules cannot have
	   any affect on _this_ module. (And here I count
	   any module in the import tree as imported - at
	   least in terms of recompilation dependancies)

The conclusion appears to be it is overlapping instances
that cause code to be 'breakable' by simply defining a new
instance and not closing the class. Closing the class
would appear to have no adverse affects on existing 
programs (as it allows better improvement rules) all existing
programs that compile without the better improvement rules
should still compile - just a few more programs will be
valid with the closed assumption?

	Keean.


More information about the Haskell-Cafe mailing list