
14 Feb
2008
14 Feb
'08
3:21 p.m.
On Fri, Feb 08, 2008 at 09:35:34PM +0100, Twan van Laarhoven wrote:
David Menendez wrote:
Isn't the MonadPlus approach also by-default-safe?
Safe, yes, but is it more useful?
Yes. In this case, take a parsing monad for example. You could write:
parseInt :: CharParser () Int parseInt = do ds <- many digit readM ds
And it would work automatically. A reading error would be propagated to the parser monad, and it would backtrack/report the error/whatever.
Yes. this is exactly the sort of thing I use this for. (I have had readM in my standard toolkit for a while). John -- John Meacham - ⑆repetae.net⑆john⑈