Does someone know why 'elt' in MyFun doesn't work as expected?
I remember that even in Aldor using "S -> S" as a representation domain
was problematic, but as
http://axiom-wiki.newsynthesis.org/ProgrammingSPAD shows, coercion
inside a session seems to work fine.
Any ideas?
Ralf
=========================================================================
(1) -> I==>Integer
Type:
Void
(2) -> inc(i: I): I == i+1
Function declaration inc : Integer -> Integer has been added to
workspace.
Type:
Void
(3) -> minc := inc :: MyFun(I);
Compiling function inc with type Integer -> Integer
Type: MyFun(Integer)
(4) -> minc 3
>> System error:
invalid number of arguments: 2
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/groups/opt_out.
)abbrev category MYMON MyMonoid
MyMonoid: Category == with
1: %
_*: (%, %) -> %
rep x ==> (x@%) pretend Rep
per x ==> (x@Rep) pretend %
)abbrev domain MYFUN MyFun
MyFun(S: SetCategory): MyMonoid with
coerce: (S -> S) -> %
coerce: % -> (S -> S)
elt: (%, S) -> S
== add
Rep ==> S -> S
coerce(f: S -> S): % == per f
coerce(x: %): S -> S == rep x
elt(x: %, s: S): S == (rep x) s
1: % == per((s: S): S +-> s)
((x: %) * (y: %)): % == per( (s: S): S +-> x y s )