axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] RE: categories with parameters and defaults


From: Bill Page
Subject: [Axiom-developer] RE: categories with parameters and defaults
Date: Wed, 15 Mar 2006 13:37:16 -0500

Ralf,

On March 14, 2006 3:24 PM you wrote:
> 
> On 03/14/2006 07:09 PM, Bill Page wrote:
> > 
> > On Tuesday, March 14, 2006 9:58 AM Ralf wrote:
> >>> I suppose it would be better to write:
> >>>
> >>>    default {
> >>>      Rep == T;
> >>>      square(t: %): % == per(m(rep(t), rep(t))
> >>>    }
> >> NOOOO.... PLEASE DONT USE ANY REPRESENTATION IN A CATEGORY.
> > 
> > The 'Rep' is not a representation in a category. It is in
> > the default implementation of 'square' which is implemented
> > in some domain which satisfies this category.
> > 
> ...

You are right. I withdraw my comment. I believe that the way
Martin Rubey originally wrote it:

MyMonoid(T: Type, m: (T, T) -> T): Category == with {
   square: T-> T;
   default {square(t: T): T == m(t, t)}
}

MyWord: with { 
   coerce: String -> %;
   c:(%, %) -> %
}
   == add {
   Rep == String;
   import from String;
   coerce(a: String): % == per(a);
   c(a: %, b: %):%  == coerce(concat(rep(a), rep(b))$String) }

import from MyWord;
extend MyWord: MyMonoid(MyWord, c) == add;

---------

It is correct as it stands. I was confused about what effect
something like:

  extend MyWord: MyMonoid(Integer, +$Integer) == add;

might do. But on reviewing this, I see that although
the result is strange since MyWord then exports a
function square:Integer->Integer, it is not wrong.

Thanks.

Regards,
Bill Page.






reply via email to

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