YAP (was Re: Proposal: Remove Show and Eq superclasses of Num)

Balazs Komuves bkomuves at gmail.com
Thu Nov 3 20:01:25 CET 2011


On Thu, Nov 3, 2011 at 5:11 PM, Paterson, Ross <R.Paterson at city.ac.uk>wrote:

>
> Units are invertible elements, and two elements are associates if they're
> factors of each other.  So association is an equivalence relation; in
> particular the associates of 1 are the units, and the only associate of
> 0 is itself.
>
> Now choose a member from each association equivalence class to be the
> canonical associate for all the members of that class, choosing 1 as
> the canonical associate for the unit class.  Because there are no zero
> divisors, that uniquely determines the canonical unit for each element.
>

It seems to me that a typical Euclidean domain does not have any kind of
meaningful canonical associate / unit map. Examples:

- The Gaussian integers Z[i] (units are 1,-1,i,-i; what would be the
associated element of 5+7i ?)
- Formal power series K[[x]] over a field (units are every series with
nonzero constant coefficients),
- and probably just about any other interesting structure satisfying the
definition.

A function "a -> a" in a type class suggests to me a canonical mapping.
Thus, I would
advocate against putting associate/unit into such a Euclidean domain type
class.

(Independently of this, I also find the name "unit" a bit confusing for
something
which would be better called "an associated unit"; "unit" is already a very
overloaded word)

Balazs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111103/247b69d9/attachment.htm>


More information about the Libraries mailing list