Sorry. This is not an attempt to solve any specific problem. The goals
were specified earlier in this thread. See also message in related
thread LazyList by Martin Baker.

On Wed, Nov 9, 2011 at 3:08 PM, Gabriel Dos Reis wrote:
> Bill Page <bill.p...@newsynthesis.org> writes:
>
> | 2) If yes, is it useful? How to use it?
>
> I do not know how useful it is until you've shown concrete examples
> (Spad) illustrating why you wrote it in the first place and what it is
> useful for.

An example usage was already given earlier in this same thread which
you omitted when you quoted.

>  IMList(): Monad(Integer,List) == add
>    unit ( x:Integer ): List Integer == list x
>    mult ( x: List List Integer ): List Integer = concat x

Note especially the 2nd argument to Monad.

>
> | 3) Why doesn't this compile?  (Discussion of function versus functor.)
>
> It compiles in OpenAxiom.  I do not see a fundamental reason why it
> should not compile in other AXIOM flavours.
>

I presume you mean:

  Monad(A: SetCategory, M: SetCategory -> SetCategory): Category == with
    unit: A -> M A
    mult: M M A -> M A

Yes that does compile. Is M compiled as a function or as a functor? If
function what does M A mean in the signatures for unit and mult ?

The code that does not compile is when we try to use it. See above or

http://axiom-wiki.newsynthesis.org/SandBoxMonads#msg20111109124013-0...@axiom-wiki.newsynthesis.org

> | 4) Is there another way to write it that does compile and that would
> | be a useful way to represent a monad-like construction in Axiom?
>
> It compiles; I have no idea how you wanted to use it, so I cannot tell
> you whether it is useful.
>
> | 5) What would have to change (if anything) in Axiom to allow it or
> | something similar to compile?
>
> At the moment, the definition you gave (when properly written in Spad
> syntax) compiles.  That alone does not say much to me, because I do not
> know exactly how you are using it.  So far it is just a category!
>

Is it really a category? Can you show example code that uses it successfully?

> | 6) Should we be able to pass functors as arguments, store them in
> | variables, etc. the way we do with functions (and as implied in the
> | original Axiom literature)?
>
> Which functors do you want to pass?  Example of code.
>

I am sorry you missed the example I gave earlier in this thread.

> | 7) What type (if any) should be associated with a functor?
>
> Every functor in AXIOM has a type.  You get it by executing
>
>   )boot getConstructorSignature ctor
>
> where <ctor> is the name of the constructor you want, e.g. 'List,
> 'Integer, etc.

In FriCAS I get with Complex for example:

)boot getConstructorSignature 'Complex

(|getConstructorSignature| '|Complex|)
Value = ((|Join| (|ComplexCategory| |#1|)
          (CATEGORY |package|
           (IF (|has| |#1| (|OpenMath|))
               (ATTRIBUTE (|OpenMath|))
               |noBranch|)))
         (|CommutativeRing|))

--

How would I write that type in an argument list in SPAD? Really this
issue is: Can I pass a functor as a parameter? If so, how can I write
it's type?

>  ...
> ...
> As ever, my question has always been: to what end?  What *problem* are
> you trying to solve?  Why is that solution better than the alternatives
> (for a definition of "better")?  If I do not know what problem you are
> trying to solve, how do I know that what is being proposed is in fact a
> solution to a known/serious problem in Spad?
>
> | Would this allow SPAD to be a more purely functional
> | language? Would that be a good thing?
>
> What problems are you trying to solve?  Sorry for asking again.  I must
> ask because I do not understand the goal.
>
> | Is this a useless exercise? Maybe we should stop?
>
> I do not know.  You tell me.  And this is not rhetorical.
> I am just having hard time understanding the problem you are trying to
> solve, and why it is a problem.
>

-- 
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