Proposal and discussion: Add MonadFail instance to Either
Edward Kmett
ekmett at gmail.com
Mon Aug 15 02:15:03 UTC 2016
+1 from me. it is perfectly "right sized" in terms of what it requires.
-Edward
On Thu, Aug 11, 2016 at 7:02 PM, Tobias Markus <tobias at miglix.eu> wrote:
> As suggested in the GHC Trac [1], it would be nice to have a MonadFail
> instance for Either. The original suggestion by lexi.lambda was
>
> instance MonadFail (Either String) where
> fail = Left
>
> However, it was rightfully pointed out that this instance is overly
> specific. The discussion arrived at the following alternative proposed
> by Iceland_jack:
>
> instance IsString str => MonadFail (Either str) where
> fail = Left . fromString
>
> For previous discussion on this proposal, please take a look at the Trac
> thread.
>
> I am looking forward to your input!
>
> Tobias
>
> [1] GHC Trac Ticket #12160, https://ghc.haskell.org/trac/ghc/ticket/12160
>
> --
> Tobias Markus
>
> "They who would give up essential Liberty, to purchase a little
> temporary Safety, deserve neither Liberty nor Safety."
> -- Benjamin Franklin (1706-1790)
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160814/660a2d1b/attachment.html>
More information about the Libraries
mailing list