Thu, 7 Oct 1999 08:23:23 +0200 (MET DST), Koen Claessen <[EMAIL PROTECTED]> pisze:

> So the big question is:
> 
>   "WHY does the Num class hierarchy look as it looks?"

How should it look like? Yes, at first I was confused about many
classes like RealFrac etc., but after some thinking I realized
that this is about the only sensible scheme, when we want to
polymorphically support various kinds of numbers, don't want to
artificially implement "illegal" operations (like (/) of integers as
div) and don't have a natural way of converting an integer to some
"appropriate" fractional type.

The three exponentiation operators all have their uses. They could
be unified only if Haskell supported overloading, or when we accept
unneeded type conversions back and forth, or if Haskell's type system
looked differently, or when we loss expressiveness.

I have no idea how to make it simpler without drawbacks.

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
 \__/          GCS/M d- s+:-- a22 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