On Apr 21, 2008, at 11:18 AM, John Goerzen wrote:
In the case of using "error", we can happily process the data assuming
everything will be fine, and raise an error if and when it is
encountered.
By using Either, however, any pattern match on the Left/Right
result is
going to force the entire input to be evaluated so that we can know
whether
or not it had any error.
Is this analysis sensible? If so, are there better solutions?
In another thread back on March 12 ("Exception handling when using
STUARrray")
I read `Since the decision between Left and Right requires all parts
to be
evaluated, it's Either that might too strict for your application.
What about
a writer monad, where exceptions, or better say warnings, are written
to the
writer stream?'
I don't believe I ever got around to evaluating that recommendation
(lazy
evaluation strategy, indeed.) I think I would use "error".
Donn Cave, [EMAIL PROTECTED]
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe