> The point is that 'map' may make extra assumptions.  For example 
> OutputForm of polynomials is produced via 'map'.

I think, I did not speak about map with the signature

  map: ((A->B), SomeStructure A) -> SomeStructure B

but of

  map: (A->A , SomeStructure A) -> SomeStructure A

However, what I said should not be too different.

If x: SomeStructure A has a concept of order (like List or Queue), and
get: SomeStructure A -> A is a function of SomeStructure(A), that
extracts elements from A (maybe like "extract!"), then
get(map(f, x) should be equal to f(get x). In that sense map should
respect the order.

> Similarly, 'f' mapping over queue of group elements may produce
> product of elements from previous calls and current call -- if you
> change order of evaluation you would break it.

Sorry, but that sounds more like a fold function than map.
Such functions are called "reduce" in FriCAS. Am I wrong?

If I want to produce what you said above (that's how I understand your
sentence) I would use

u:=0; [u:=f(x,u) for x in [a,b,c,d]]

Can you give a concrete example from Algebra that uses by side effects
some evaluation order of the structure?

Ralf

-- 
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 https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to