Sun, 21 May 2000 01:00:18 +1000, Fergus Henderson <[EMAIL PROTECTED]> pisze:

[...]

I still think that a better solution is to design classes used in
resolving special syntax in a such straightforward way that everybody
should be happy to use, even when he throws away most of Prelude.

fromInteger would live in a separate class alone. Eq is needed when
numeric literals are used in patterns, so the Eq context would be
additionally generated in such case (now Eq is a superclass of Num
and thus availability of fromInteger implies availability of (==)).

The class that defines [a..b], [a..], [a,b..c], [a,b..] would hold
only these operations. No dependency on Int is needed.

I would leave "do" and unary negation as is. Monads are too deeply
used to replace them with a custom class; in a very rare case one
needs, he would simply not use the "do" syntactic sugar. Remember
that it would not be possible to have several definitions of "do"
in one place anyway - you cannot qualify implicitly inserted operators.

A disadvantage is that it would be no longer possible to define toEnum
and fromEnum while getting [a..b] etc. automatically derived from them.

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/              GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                  W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to