[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-math] What is the "+/" operator?
From: |
Gabriel Dos Reis |
Subject: |
Re: [Axiom-math] What is the "+/" operator? |
Date: |
Wed, 23 May 2007 20:07:10 -0500 (CDT) |
On Wed, 23 May 2007, Bill Page wrote:
| (4) -> (+)/[1,2,3]
| Compiling function / with type (((Integer,Integer) -> Integer),List
| Integer) -> Integer
|
| Based on this I tentatively withdraw my object. However as you
| point out:
|
| empty? l => 0
|
| is bogus. What we want is something like:
|
| empty? l => Unit(f)
|
| where f(x,Unit f) = x.
Yes.
That should not come as a surprise to Axiomatizers. Here is why: List T is a
monoid with
(*) append as the monoid operation,
(*) and the empty list being the unit.
Consequently, sum or product, etc. are just *catamorphisms" you would express
naturally through the reduction functional (also known as "fold" in the
functional programming community). There is a good paper that should probably
be linked from Axiom's website:
"Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire"
Erik Meijer, Maarten Fokkinga, and Ross Paterson
http://wwwhome.cs.utwente.nl/~fokkinga/index.html#detail_0000003415
I must admit that where I first realized (four years ago) that Aldor (and
Spad) actually have the tokens "(|", "|)", "[|, "|]", "{|", and "|}",
I thought they were to support that kind of algebraic programming. However,
The Aldor manual just says they are reserved for future use without saying
much.
-- Gaby
- Re: [Axiom-math] What is the "+/" operator?, (continued)
- Re: [Axiom-math] What is the "+/" operator?, Ralf Hemmecke, 2007/05/23
- Re: [Axiom-math] What is the "+/" operator?, Bill Page, 2007/05/23
- Re: [Axiom-math] What is the "+/" operator?, Gabriel Dos Reis, 2007/05/23
- Re: [Axiom-math] What is the "+/" operator?, Ralf Hemmecke, 2007/05/23
- Re: [Axiom-math] What is the "+/" operator?, Gabriel Dos Reis, 2007/05/23
- Re: [Axiom-math] What is the "+/" operator?, Ralf Hemmecke, 2007/05/24
- Re: [Axiom-math] What is the "+/" operator?, Gabriel Dos Reis, 2007/05/24
- Re: [Axiom-math] What is the "+/" operator?, Gabriel Dos Reis, 2007/05/23
Re: [Axiom-math] What is the "+/" operator?, Gabriel Dos Reis, 2007/05/23
Re: [Axiom-math] What is the "+/" operator?, Bill Page, 2007/05/23
- Re: [Axiom-math] What is the "+/" operator?,
Gabriel Dos Reis <=