On Wednesday 09 Nov 2011 20:08:13 Gabriel Dos Reis wrote:
> Bill Page <bill.p...@newsynthesis.org> writes:
> | 1) Does this code (in principle) capture the notion of Monad?
>
> For me, it is just a set of signatures; I should NOT be the person
> being asked to reverse engineer what you wrote! :-)
>
> | 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.

In a Haskell monad we can model the form of a monad, that is an
endofunctor equipped with two natural transformations like this:
unit: A -> M A
mult: M M A -> M A

I am trying to build a Haskell typeclass and implementations of it
like this:

  class Functor m => MyMonad m
where
    eta :: a -> m a
    mu :: m (m a) -> m a

However it is only in each implementation of this typeclass that the
axioms for a monad are enforced. So, even in Haskell, we don't have
one single construct that encapsulates all the properties of a monad,
I find it hard to imagine how any language could encode the axioms for
a monad in such a way that they are automatically enforced in all its
implementations. Perhaps it could be done by introspection of the code
(I am guessing that is why Bertfried is looking at the Lisp/Boot
code?)

I guess that the same with other SPAD categories: that the axioms are
only enforced in its implementations.

Given the importance of the monad concept in both mathematics and
computer science, it would be good if SPAD had, at least, as much
support for this concept as Haskell has.

Martin

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