[Haskell-cafe] Laziness and Either
donn at avvanta.com
Mon Apr 21 14:40:45 EDT 2008
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
> 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
> 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
I read `Since the decision between Left and Right requires all parts
evaluated, it's Either that might too strict for your application.
a writer monad, where exceptions, or better say warnings, are written
I don't believe I ever got around to evaluating that recommendation
evaluation strategy, indeed.) I think I would use "error".
Donn Cave, donn at u.washington.edu
More information about the Haskell-Cafe