[MLton] Monadic MLton.Vector.create
Henry Cejtin
henry.cejtin@sbcglobal.net
Tue, 28 Mar 2006 16:22:52 -0600
No, I don't believe that monads are powerful enough in a language with side
effects. The function that is passed update can put it in a ref cell.
I was thinking of the older style for I/O in purely functional languages: you
have to have a the functions return to their callers, passing both what they
want done (sub or update) and also a continuation. Using that, and in the
absence of call/cc, the create function could be certain that update wasn't
called after it returns.
I would say that the result is pretty ugly because of the need to pretty much
handle the continuations by hand in the tabulator and whacker functions.