[Haskell-cafe] What is MonadPlus good for?
David Roundy
droundy at abridgegame.org
Sun Feb 13 18:14:02 EST 2005
On Sun, Feb 13, 2005 at 06:05:23PM -0500, ajb at spamcop.net wrote:
> G'day all.
>
> Quoting David Roundy <droundy at abridgegame.org>:
>
> > It might be interesting to write a "backtracking" IO-like monad which
> > obeyed m >> mzero === mzero. I imagine you could do it for something like
> > an ACID database, if you define === as meaning "has the same final result
> > on the database", which of course would only be useful if the database had
> > sufficient locking that it couldn't have been read between the original m
> > and the later mzero.
>
> You should talk to the logic programming community about this some time.
>
> As Lee Naish has pointed out on many occasions, it would involve finding a
> way to insert the page back into the laser printer and lift the toner off.
That's why it would only be possible in a limited realm such as a database,
where you could "quarantine" the changes using locking, and where you could
define strictly define "equality" in the world in which the IO takes place.
It basically would just require a journalling system, which I imagine most
decent databases provide in order to give ACID behavior. I'm far from a
database expert, but this is how I understand that these things work.
--
David Roundy
http://www.darcs.net
More information about the Haskell-Cafe
mailing list