Haskell 98 - Standard Prelude - Floating Class

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
18 Oct 2001 15:16:28 GMT

Thu, 18 Oct 2001 13:49:11 +0200, Karl-Filip Faxen <kff@it.kth.se> pisze:

> There are two solutions that I can see: Annotate classes in class 
> constraints with exactly which methods were used. Thus for the
> expression "x+y" the inference algorithm would record the constraint
> "Num{+} a" if x and y has type a in the type environment. Then if
> an instance declaration for type Wurble omitted +, that instance 
> declaration would not allow us to simplify "Num{+} Wurble".

This is equivalent to putting all methods in separate classes.

IMHO missing method definitions should be detected where the instance
is defined, not when it's used. You can still define diverging
methods explicitly or manually split the class if you really want
partial instances.

 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
  ^^                      SYGNATURA ZASTĘPCZA