From: "Vivian McPhail" <vivian.mcphail@paradise.net.nz>
To: <haskell-prime@haskell.org>
Subject: Numeric Class reworking
Date: Mon, 17 Jul 2006 10:58:48 +1200
Message-ID: <003801c6a92b$6665e700$4501a8c0@box>
MIME-Version: 1.0
Content-Type: text/plain; charset="windows-1250"
X-Mailer: Microsoft Office Outlook 11
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
Thread-Index: AcapK2YIjWdPgveYTKWj6G1G7tDMqA==
Content-Transfer-Encoding: 7bit

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
 

