[Haskell-cafe] Closed Classes

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Thu Aug 12 16:23:17 EDT 2004

On Thu, Aug 12, 2004 at 06:37:20PM +0100, MR K P SCHUPKE wrote:
> Surely it must be safe to assume a closed class at the top level?

This could be a source of unpleasant surprises, ie. something works
at top level, but breaks when you move it to some module. If by
top level you also mean Main (as opposed to interactive "toplevel"), it
would be much more surprising. I often experiment by writing a single
module program and split it to many modules later.

Anyway, (with extensions) it is possible to write code which would be
broken by closed world at top level, for example:

    g :: (forall a. A a => a -> a) -> something

and somewhere else

    ... (g f) ...

Best regards,
.signature: Too many levels of symbolic links

More information about the Haskell-Cafe mailing list