Hi,
Peter Thiemann wrote:
> Has anyone implemented or knows of an implementation of arithmetic
> operations on multivariate polynomials in Haskell? I would prefer a
> solution that uses type classes in an essential way to overload + and
> *, so that I can freely add and multiply polynomials in *different*
> variables.
Try having a look at the following paper:
Explaining algebraic theory with functional programs
Jeroen Fokker
http://www.cs.ruu.nl/people/jeroen
which includes implementations of groups, rings, and fields. A number of
instances of these structures are presented, explaining the construction
of integers, quotients, and polynomials. The later construction allows the
calculation of gcd for polynomials over an arbitrary field.
Note, that although the examples given in the paper were written with the
Gofer development system in mind, they should run under Haskell 1.3 with little
or no changes.
Many regards
Ben
--------
Benedict R. Gaster.
Functional Programming Group, Nottingham University.
Category theory: This is how our children will program!