On Mon, Dec 5, 2011 at 6:37 PM, Gabriel Dos Reis wrote:
> Bill Page <[email protected]> writes:
>
> [...]
>
> | I reported this as a bug in OpenAxiom
> |
> | 
> http://sourceforge.net/tracker/?func=detail&atid=984524&aid=3448475&group_id=203172
> |
> | Recent changes in OpenAxiom have changed the error message. The
> | original message "cannot form Join" is probably more indicative of
> | what is going wrong. The "apparent user error"
>
> It is indeed "apparent user error" :-)
>
> When you write
>
>  MySet(T:SetCategory): Join(MonadCat(T,MySet),SetAggregate(T)) with --...
>
> At the point where you are using MySet as argument to MonadCat, there
> is no indication of what the return type of MySet, and that is apparent :-)
>

There are numerous cases in the library where % occurs in the type of
a constructor. Consider:

-- lodop.spad.pamphlet: --
...
OrdinaryDifferentialRing(Kernels,R,var): DRcategory == DRcapsule where
    Kernels:SetCategory
    R: PartialDifferentialRing(Kernels)
    var : Kernels
    DRcategory == Join(BiModule(%,%), DifferentialRing, HomotopicTo R) with
        if R has Field then Field
    DRcapsule == R add

--

Apparently % refers to the functor 'OrdinaryDifferentialRing' applied
to the arguments '(Kernels,R,var)' but the compiler does not complain
of an apparent user error even though obviously there is no indication
of what the return type of 'OrdinaryDifferentialRing' is at that
point. Is this use of % somehow special to the compiler?

In another email thread I was asking for a method to refer to just the
functor, e.g. just  'OrdinaryDifferentialRing' not the whole
expression 'OrdinaryDifferentialRing(Kernels,R,var)'.  Suppose this
was denoted by %%. Then

   %%(Kernels,R,var)

would supposedly be equivalent to %.

This %% is essentially what I wanted to write instead of 'MySet'
above. It seems to me that whatever is special about % could also be
special about %%, no?

I would like to be able to declare that some domain constructor is a
monad in the same way that 'OrdinaryDifferentialRing' is declared to
satisfy 'BiModule(%, %)'. But to do this I need a way to refer to
"this functor" because in the definition of MonadCat I need to be able
to apply that functor twice. In this case the use of % (a single
application of the functor) is not enough.

  %%( %%( A ) )

> | Cannot coerce #1 of mode Type to mode SetCategory
>
> There is a cascade of errors, and this one relates to dependent
> contravariant coercion that I discussed a couple of weeks ago.
>
> | suggests to me that perhaps the compiler is not passing all the
> | information about the types of the arguments to MonadCat or perhaps
>
> that is correct.  But the use of MySet as argument of MonadCat needs to
> be fixed first.
>

Is possible to reference MySet implicitly as "this functor" in a
manner similar to the use of % ?

> | that the type inference is somehow incomplete. I expect that the more
> | recent message "The value NIL is not of type DATABASE." is likely due
> | to unrelated changes that Gaby is currently making to the compiler.
> | But that is just a guess.  I wish I had enough time and skill to
> | actually work on these sort of compiler internals. These are in short
> | supply in all the Axiom projects. Although fixing this or explaining
> | why should not work may not be a currently priority, I am fairly sure
> | that the changes Gaby is making to the compiler will eventually
> | resolve it one way or another.
>
> Believe it or not, Gaby has a lot on his hands -- far more than it can
> handle just now :-)
>

Understood and much appreciated!

> I appreciate bug reports in experimenting with new constructs.
> One should also note that transliterating Haskell into Spad can be
> as fun and entertaining as transliterating English to French or the
> other way around.  Certain things will just sound OK; others might
> give you a pause :-)
>

Sure, but the abstraction of "monad" really has nothing directly to do
with Haskell of other languages as such. It seems reasonable to
consider independently how this notion should be expressed in Spad.

Regards,
Bill Page.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to