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

Daniel Fischer daniel.is.fischer at googlemail.com
Thu Nov 3 21:14:23 CET 2011

On Thursday 03 November 2011, 20:01:25, Balazs Komuves wrote: 
> It seems to me that a typical Euclidean domain does not have any kind of
> meaningful canonical associate / unit map.

I agree.

> 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),

This one has a fairly canonical representative for the classes of 
associated series: X^n, where n is the index of the first nonzero 

> - 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.

True, but I think we'd need such functions to have well-defined "canonical" 
factorisations for example.

> (Independently of this, I also find the name "unit" a bit confusing for
> something
> which would be better called "an associated unit";

Except here, where 'associated' means 'equal up to multiplication with a 

> "unit" is already a very overloaded word)


More information about the Libraries mailing list