Proposal: Add Text.Read.maybeRead :: Read a => String -> Maybe a
lemming at henning-thielemann.de
Fri Feb 8 05:39:18 EST 2008
On Fri, 8 Feb 2008, John Meacham wrote:
> On Fri, Feb 08, 2008 at 12:17:31AM -0500, David Menendez wrote:
> > I also prefer Maybe to fail. Error strings are only useful if you're
> > ignoring them or passing them to the user without interpretation.
> say that next time you get a mysterious "fromJust: Nothing" error with
> no context, error messages in haskell are quite an issue as is, _any_
> useful information is good, passing them on to the user without
> interpretation is loads better than not having any clue what went wrong.
Since 'error' denotes a programming error, not an exception, there is no
need that the user understands the error message. It is entirely the task
of the programmer to understand the message or its absence and it would
be completely ok if the program aborts with "the programmer made a
mistake, please complain to him".
More information about the Libraries