>> class Subtraction a b | a -> b where
>>   (-) :: a -> a -> b
> 
> If you split them up like this, things like quadRoots take an
> unwieldly type signature: [...]

ultimately this leads to a style of programming
where you have a  class Has_f  for each function symbol  f.

then the signature of a function contains
all the (wrapper class) names of all the functions
it intends to call.

This shows that type classes are "just" a means
for expressing implicit parameters to functions
(the parameters are the class methods,
and the (invisible) dictionary transports them).

Their usability still is limited
because all (data and) class and instance declarations are global.
Is there a fundamental (design or implementation) reason for this?
I really sometimes would want to write

let { instance Show Foo where ... } in   show ...

or

let data Bar = ... in  ...

Compare Java where you can have nested classes and interfaces.
Where of course part of their motivation is
that Java lacks proper (and anonymous) functions.

Best regards,
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- http://www.imn.htwk-leipzig.de/~waldmann/ -------

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to