Are anonymous type classes the right model at all? (replying to Re: Are fundeps the right model at all?)

Marcin 'Qrczak' Kowalczyk
26 Dec 2000 08:46:44 GMT

Tue, 26 Dec 2000 12:10:55 +1100, Fergus Henderson <> pisze:

> Mercury's module system allows instance declarations (which, as in
> Haskell 98, are unnamed) to be selectively exported.

If they could be selectively exported in Haskell, how to make it
compatible with the current assumption that they are exported by
default? Selective hiding would be weird.

Perhaps there should be a separate section for exporting instances.
If not present, then everything is exported (as with plain module

I hope selective export would help with resolving conflicting
instances. There might be a confusion if a function does indeed
get a sorted list of objects of type T but it expected a different
ordering, but the danger of inability of linking two independent
libraries due to an innocent overlapping instance might be worse.

As we are at it, it would be nice to be able to specify signatures and
other interface details where they belong - in the export list. With
a different syntax of the export list; there would be an ambiguity if
    ..., var1, var2 :: Type, ...
gives Type to both variables or only one, and items should be
separated by layoutable semicolons.

 __("<  Marcin Kowalczyk *
  ^^                      SYGNATURA ZASTĘPCZA