[Haskell-cafe] Re: What are the MonadPlus laws?

Ralf Laemmel Ralf.Laemmel at cwi.nl
Wed Jan 26 06:26:08 EST 2005


Jules Bean wrote:

> Are there any interesting programming uses of MonadPlus apart from 
> 'calculations returning multiple values'.. i.e. 
> lists/sets/multisets/maybe?

Just a minor point ...

You mention Maybe in the list above but I would like to
wonder whether it is fully appropriate to associate it with
"calculations returning multiple values". Depending on what
you find interesting, I would like to mention *biased binary choice*.
Try the left operand first, if it fails, try the second operand. For
instance, this is a key idiom in strategic programming with Strafunski
(and has been adopted from Stratego). All in all, this more like "try
and catch" or "exception handling" rather than "calculations returning
multiple values".

Ralf

-- 
Ralf Laemmel
VU & CWI, Amsterdam, The Netherlands
http://www.cs.vu.nl/~ralf/




More information about the Haskell-Cafe mailing list