> Could you provide an example implementation of map for Functor(E) in
> AbelianMonoidRing?
>
> Given that over AbelianMonoidRing there are functions like
>
>   f(a:R):(% -> %) == (x:%):% +-> a * x
>
>  I do not see how this is possible. Perhaps I am missing something.

Again, what's important to implement "map" is signature, this will be
more clear in Monad.

So for AbelianMonoidRing(R,E) we implement Functor(E):
map : (E->E, %)->%
map(f, x) ==
  zero? x =>0
  monomial(leadingCoefficient x, f degree x)+map(f, reductum x)

Your example function f has signature of '%->%', not 'E->E'.

> Could you give some examples of the disadvantages of such automatic
> currying?

Automatic currying is not that useful, especially in Spad:
Say we have f:(A,B)->C and f:(A,B,C)->D, then f(a:A) will be a nightmare
for both human and compiler.

Automatic currying will only curry its first argument, often we need to
curry other arguments, then what to do?  Use 'flip'?
For f:(A,B)->C and a:A,b:B compare
x+->f(a,x)  vs.  f(a)
x+->f(x,b)  vs.  (flip(f))(b)

Manually currying (aka. write single argument anonymous function) is useful,
automatic currying, not so much.

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
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