Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. MonadError example (Giacomo Tesio)
----------------------------------------------------------------------
Message: 1
Date: Mon, 12 Nov 2012 01:04:50 +0100
From: Giacomo Tesio <[email protected]>
Subject: [Haskell-beginners] MonadError example
To: "[email protected]" <[email protected]>
Message-ID:
<cahl7psfhgxaeeatqv1w-xpwtamtmxdmdwmatjboams9kbbj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi, I'm looking from an example of MonadError usage for exception handling.
After reading this http://mvanier.livejournal.com/5343.html I'd like to see
an example with two different error types handled in the same function.
I mean I have
f :: a -> Either e1 b
g :: b -> Either e2 c
and I want to write a new function
z :: a -> Either e3 c
using f and g.
(with Either e1, Either e2 and Either e3 all instances of MonadError)
e3 could provide constructors like E1Occurred e1 and E2Occurred e2 (to
mimic inner exceptions)
I'd like to see how readable would be z.
Can you point me to a snippet or even a real codebase showing such thing?
Giacomo
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20121112/39104a4e/attachment-0001.htm>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 53, Issue 16
*****************************************