[Fwd: Numeric Class reworking]
Ross Paterson
ross at soi.city.ac.uk
Wed Jul 26 18:57:43 EDT 2006
On Mon, 17 Jul 2006 10:58:48 +1200, Vivian McPhail wrote:
> 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/
The numeric prelude package (though the documentation is hard to follow
with all the classes called C and types called T) seems to consist of
two layers:
- a bunch of unary classes refactoring the Haskell 98 numeric class
hierarchy, and
- multi-parameter classes, building on the former classes, for vector
spaces and related concepts.
A refactoring like the former would be useful on its own, and would
provide a base for adding the other classes later.
Of course the algebraic properties won't be satisfied by floating
point arithmetic.
More information about the Haskell-prime
mailing list