i)  Maybe is implemented in BOOT
ii)  constructors like List are also coded in BOOT, and there is no
(know to me, you, any?)
     way to do this in SPAD

At least for Aldor that is simple, but I believe for SPAD there is no difference in this case.

http://svn.origo.ethz.ch/wsvn/algebraist/trunk/aldor/lib/aldor/src/base/sal_partial.as
http://svn.origo.ethz.ch/wsvn/algebraist/trunk/aldor/lib/aldor/src/datastruc/sal_list.as

Partial (which corresponds to Maybe) and List are completely library-defined in libaldor.

And you probably see that the unit in Partial is a simple coerce function. In List, it is not available, because it seems to be uninteresting, to just produce a one-element list. But it can, of course, easily be implemented via unit(t:T): % == cons(t,empty).

The join or mult operation is not available with a signature
M M A -> M A. The reason is simply that you cannot express this signature when you are inside List or Partial. The closest one can get would be

  List(%) -> %      or    Partial(%) -> %.

That, however should work, even if one has to explicitly refer to the name of the domain that one is going to define. It's just that you cannot define it with an anonymous "add" structure.

But all that only implements the functionalities of monads. It doesn't make the concept of a monad available in Aldor/SPAD, such that one could inherit the signatures from that (coded) concept.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to fricas-devel@googlegroups.com.
To unsubscribe from this group, send email to 
fricas-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to