On 2001-05-18T08:56:57+0200, Jerzy Karczmarczuk wrote:
> The examples are already in the Wadler's "Essence". Imagine the
> construction of a small interpreter, a virtual machine which not only
> evaluates the expressions (belonging to a trivial Monad), but perform
> some side effects, or provides for exceptions propagated through a
> chain of Maybes. Then the idea is to
>
> * base the machine on the appropriate Monad
> * "lift" all standard operators so that an innocent user can write (f x)
> and never x >>= f (or even worse).
Perhaps you already know about Filinski's PhD thesis? He seems to
have proven that we already have the "small interpreter" you want,
inside of any programming language that supports call/cc and storing a
function in a single storage cell. ML is such a programming language.
You can define your own monads yet rely on implicit evaluation
ordering in ML to do the lifting you want!
--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
Learn Esperanto and make friends around the world
http://www.esperanto.net
PGP signature