>(2) Occurs quite regularly:
> You are adding a constructor to an algebraic data type in a module
> which is required by many others. However, the new constructor
> is only used in a single module. Nevertheless, you have to recompile
> a lot of modules. As long as you had hugs, you could test your
> changes before starting a long recompilation with ghc.
This is called the "fragile base class" problem in OOP: For example, C++
has it, Java does not.
> Recompilation would be
> restricted to the module that contains the data type definitions and
> the access functions. I'm sorry if that's already possible
> or against some fundamental principles.
The reason that C++ has it, is that methods are looked up by offsets in the
object code only. Compilers usually do not know how to check if the offsets
change if an included source is changed, so it must be recompiled.
Java solves this by allowing the methods to be looked up by names at
runtime, which is slow. One optimization for time is to cache the offset so
found, so it need not be looked up again until the module itself is changed.
This is a variation of dynamic linking. OS object code formats for dynamic
linking are readily available, for example MacOS has PEF (PPC Executable
Format), a variation of IBM's XCOFF which Apple bought the use of.
So this is something that is fixable.
Hans Aberg