[Haskell-cafe] Errors in non-monadic code
Patrick Mylund Nielsen
haskell at patrickmylund.com
Mon Aug 19 23:27:48 CEST 2013
On Mon, Aug 19, 2013 at 5:24 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> On Mon, Aug 19, 2013 at 05:15:39PM -0400, jabolopes at google.com wrote:
> > But I would like to see more code move away from exceptions and into
> > types like "Maybe" or "Either" or other types defined for the
> > particular situation (as some people were suggesting in the beginning
> > of the thread). And the reason for this it is because when you program
> > against types you have to make a decision whether to handle the error
> > or let it bleed through: you can't ignore the choice because you can't
> > ignore the type. On the other hand, with exceptions, you can easily
> > forget to handle the exception if you're not looking at the
> > documentation at the time when you write the code.
>
> This is /exactly/ the reason to avoid exceptions where possible.
>
> Tom
>
>
And tangentially related, it's why Go uses error return values (with
functions being able to "return multiple values"), e.g.
http://blog.golang.org/error-handling-and-go
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130819/d5e8fb16/attachment.htm>
More information about the Haskell-Cafe
mailing list