[Haskell-cafe] Tutorial: Haskell for the Evil Genius
Brandon Allbery
allbery.b at gmail.com
Sat Sep 15 03:22:55 CEST 2012
On Fri, Sep 14, 2012 at 9:08 PM, Andrew Pennebaker <
andrew.pennebaker at gmail.com> wrote:
> Given that Maybe and Either don't modify state, nor do they communicate
>> with outside interfaces, nor do they specify computation ordering, I don't
>> understand why they're implemented as monads. Why not a primitive typeclass
>> or even datatype declaration?
>
>
They're not used in their monadic guise as often as they should be, IMO.
Either String has for a while been an "error monad" (more commonly,
EitherT String as ErrorT) but has annoying shortcomings --- but they're an
obvious mechanism for reporting and tracking / short-circuiting failure in
computations (carrying a failure reason in the case of Either).
--
brandon s allbery allbery.b at gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120914/f30adb78/attachment-0001.htm>
More information about the Haskell-Cafe
mailing list