date:  Fri, 18 Feb 1994 10:54:58 GMT
    from:  Gavin Wraith <[EMAIL PROTECTED]>

    
    Concerning Haskell 1.3 + n
    --------------------------
    Am I alone in finding the standard prelude for Haskell unsatisfactory
    when it comes to dealing with different sorts of numbers and how they
    are related? 
    
    [stuff omitted]

    I am not suggesting that everybody would want to do this, but the
    present use of Num is far too monolithic and inflexible for sensible
    exploitation of Haskell for mathematical purposes. I would be interested
    to hear what others feel about this.

Related to this: my impression is that Haskell's numeric classes do not
support equational reasoning well.

The main reason is that they do not distinguish between exact and
inexact arithmetic.  The associative law (for example) does not hold
for floating point addition - but it does for integers, rationals and
constructive reals.  Numerical analysts (or people who write, say,
computer graphics code) will be happy to supply lots of examples where
this difference is important in practice.

A class hierarchy based on mathematical structures like Rings, Fields
and suchlike might be cleaner and clearer.  Then, the properties
of a class can be made explicit (even if it's only in comments at this
stage).

Paul

Reply via email to