[m-users.] Document "Module typeclasses should be instantiated in the interface"

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri May 14 21:06:37 AEST 2021


2021-05-14 20:59 GMT+10:00 "fabrice nicol" <fabrnicol at gmail.com>:
> So, the 'pragmatic' improvement that I am advocating could not go beyond a warning message at library compile time.

Unfortunately, there is no such thing as "library compile time".
The Mercury compiler works on one module at a time, even if you
give it more than one module to compile.

> Alternatively, it could be implemented in the linker after all the dependency graph has been resolved, if it is found that there is a typeclass with no one type to satisfy it.

It could be implemented in the linker, but Mercury does not have one.
It uses the standard system linker for its target language. Adding our own
linker would be a huge maintenance burden.

Zoltan.


More information about the users mailing list