>> On Tue, Dec 9, 2008 at 6:35 PM, Martin Rubey wrote:
>> >
>> > forall A if A has MyCat then CoercibleTo A
>> >
> Bill Page writes:
>> I presume that you mean that one might write this in the context
>> of some domain, say B.
>>
>> Isn't this essentially what one might do in defining a package?
>> E.g.
>>
>> MyCoercePac(A:MyCat,X:CatOf(B)): CoercibleTo(A)
>> == add
>> coerce(x:X):A == ...
>>
>> At least in the interpreter if 'MyCoercePac' is exposed than the
>> interpreter can expect to find a function 'coerce' for all domains
>> A in MyCat.
>
There is an error my example. We can not just use 'CoercibleTo(A)'
here since it refers to %. Also there is no 'CatOf' category
constructor in FriCAS. So we have to write:
MyCatCoercePac(A:MyCat, B:SetCategory): with
coerce:B->A
== add
coerce(x:B):A == ...
On Wed, Dec 10, 2008 at 9:21 AM, Martin Rubey wrote:
> But A has CoercibleTo B will be false...
Perhaps you meant to write: "But B has CoercibleTo A will be
false..."? If so, in my proposal that is correct.
You want to create a situation where a given domain, say B, is known
to be coercible to any domain in some category MyCat without having to
explicitly list all the domains that have MyCat, e.g.
Join(CoercibleTo(A1), CoercibleTo(A2), ... )
where A1 has MyCat and A2 has MyCat, etc. In B you also provide an
implementation for all of these coercions.
Right?
Now in some new domain or in the interpreter instead of checking for
'B has CoercibleTo(A)' you could just check for 'A has MyCat' and
import MyCatCoercePac.
> (we had this discussion very recently)
I thought that discussion ended without any definite conclusion.
Regards,
Bill Page.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---