[Haskell-cafe] Error monads (was: Call for comments: neither
package)
Roman Cheplyaka
roma at ro-che.info
Tue Jun 29 10:15:43 EDT 2010
* Stephen Tetley <stephen.tetley at gmail.com> [2010-06-29 12:02:45+0100]
> The "Applicative Programming with Effects Paper" has the "monodial
> accumulating" applicative instance on a sum type Conor McBride and
> Ross Paterson call Except:
>
> data Except err a = OK a | Failed err
>
> The names are nice and to the point, but they would equally describes
> the other exception model (monadic - exit on first fail) and having
> both might be particularly confusing to newcomers: two error types -
> one with an obvious name, one with an unfamiliar one, the unfamiliar
> one might be the one they need most often...
On a slightly related note, in my projects I tend to define my own
Error-like types with descriptive names, often more than one failure
mode and apropriate instances. For an example of this approach, see
http://github.com/feuerbach/loker/blob/master/testingtool.hs#L33
--
Roman I. Cheplyaka :: http://ro-che.info/
"Don't let school get in the way of your education." - Mark Twain
More information about the Haskell-Cafe
mailing list