Subject: Numeric Class reworking
From: "Vivian McPhail" <[email-masked]>
To: <[email-masked]>
Date: Mon, 17 Jul 2006 10:58:48 +1200

Hi,
<quote>
One of the complaints I've seen with people trying to do various
mathematical tasks in haskell is the inflexibility of the numeric
prelude.  The biggest issue is having (*) and (+) in the same
typeclass, but other generalizations are certainly possible.
MPTC would allow such things as modules with (*) having type a -> b -> b
which covers everything from group actions to scalar multiplication
of vectors.

Actually, a -> b -> c would be nice.  See
http://haskell.org/hawiki/DimensionalizedNumbers
<http://haskell.org/hawiki/DimensionalizedNumbers>  
this would let me have multiplication of numbers with units, enforced at
the type level, while keeping the safety of (+) :: a -> a -> a.

Is there any chance of this sort of breakup happening?

-- 
Aaron Denney
-><-
</quote>

Haskell is often cited as an elegant and 'mathematical' language in which to
program.  This post is to voice my support for a modified Numeric Prelude
that would be consistent with [1] and/or [2].  It would be an improvement if
the numeric classes were more structured along the lines of algebraic
properties (similar to the monad laws) of various entities.

I remember griping about this when I first learned Haskell.

While the typical user may not need to know about the underlying
mathematical structure of the objects that they are working with, it would
be good if the system were consistent for those that do.

[1] http://haskell.org/docon/
[2] http://cvs.haskell.org/darcs/numericprelude/

Cheers,

Vivian

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006