axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-math] POLY INT =\\= UP(x, INT)


From: Dylan Thurston
Subject: Re: [Axiom-math] POLY INT =\\= UP(x, INT)
Date: Thu, 9 Oct 2003 13:30:37 -0400
User-agent: Mutt/1.5.4i

On Wed, Oct 08, 2003 at 05:20:20PM -0400, Page, Bill wrote:
> SetCategory exports only one function, = . ...

I was shocked by this, so I went and checked.  It's worse than that:
SetCategory exports equality, printing (standard and LaTex), and
hashing.  This was my major peeve with the Haskell type system (in
Haskell terms, Print and Eq are parents of the Num class).

For a good reason why all 3 of these functions are absolutely wrong as
parents of, say, Ring, consider trying to define a type of constructible
reals: numbers that lazily compute themselves to as many digits as
requested.  There are good algorithms for doing this, and it would be
immensely useful for a CAS like AXIOM, but there is no way to make it
support equality, printing, or hashing.  (Well, for printing you would
probably just have it print some number of digits.  But how many digits?
That really needs to be a parameter, but there's no room for that here.)

As another way to see that these definitions are wrong, consider that
"printing" has nothing at all to do with the structure of, say, a group.
If you have a function that needs its arguments to be both in a group
and printable, it should say so, not have it be implied by the type
system!

Peace,
        Dylan

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]