At 19:20 +0200 98/07/03, Francois-Nicola Demers wrote:
>Does anyone know monads that could not been express as an
>abstraction?
I can only recall the underlying theory in math: Monads are used to
indicate a subcategory of a category which has a certain structure whose
members are "algebras" in a certain abstract sense. The objects which are
the image of the monad functor are the free algebras in this subcategory,
and one can also indicate what are the other algebras in this subcategory
and their homomorphisms.
So from this point of view, the monad is always a description of a
general structure within the category that some objects and homomorphisms
have.
For example, the list monad is in math just the functor selecting the
free monoid on a set, and the general monad algebras of the list (or
monoid) monad are the general monoids.
If you take any universal algebra, that is a set of algebras defined by
elements, operations and relations between these (like groups defined as
(G, e, *, -1) with the usual relations between these or any similar type of
general definition), then the category that ensues can also be described by
a monad. So quite a few algebraic structures can be described this way.
>and the exception monad:
>
> M a = Ok a | Error String
>
>For the exception monad, we could use instead
>
> M a = String -> (a, String)
>
>where the string represents an error. If there is an error, the string
>is non-empty and the value $a$ is not considered.
But if you attempt with the exception monad in the second variation, you
get a distinctly different behavior, because the exception monad (as in the
first variation) also says that computations should be terminated. The
second version is like sending an error message to the terminal but letting
the computations continue.
Hans Aberg
* Email: Hans Aberg <mailto:[EMAIL PROTECTED]>
* Home Page: <http://www.matematik.su.se/~haberg/>
* AMS member listing: <http://www.ams.org/cml/>