[Aldor-l] Specifying properties of functions
Ralf Hemmecke
ralf at hemmecke.de
Fri Mar 25 05:19:36 EST 2005
Hello,
In the algebra library we have something like this
define CommutativeRing: Category == Ring with {...}
It is implicitly understood that * is the function that "commmutative"
refers to.
A more flexible way to state properties of functions in Aldor would be
something like this.
define Commutative(D: Type, f: (D, D) -> D): Category == with;
define MyCommutativeRing: Category == MyRing with Commutative(%, *$%);
Of course, there is still a language feature missing to express,
"f(x,y)=f(y,x)", but at least, such a property would be explicitly
stated through a category.
Unfortunately, the attached file does not compile. The compiler claim
that it cannot figure out what * is.
Does anybody know how I would have to rewrite the program so that the
compiler accepts it?
Best regards
Ralf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xxx.as
Type: application/x-applix-spreadsheet
Size: 1020 bytes
Desc: not available
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20050325/0665ab0f/attachment-0001.bin>
More information about the Aldor-l
mailing list