<html><head></head><body>instance MonadFail (Either [Char]) <br><br>would satisfy all of the cases where I want this instance.<br><br>So would the suggestion on Trac of<br><br>instance e ~ String => MonadFail (Either e)<br><br>although that probably runs afoul of David's concerns about standards.<br><br>How do other people consume MonadFail? Maybe I'm missing an existing solution.<br><br>When a library provides a function<br><br>foo :: MonadFail m => m Foo<br><br>I usually want to recover from failure while logging the failure message. I can do this with the IO instance, but then it's not obvius that all errors are getting caught. If I'm not in IO, and I want the error text, I think I'm out of luck.<br><br><div class="gmail_quote">On October 25, 2018 7:21:51 AM UTC, David Feuer <david.feuer@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="auto">Another option is to be agnostic about it with FlexibleInstances:<div dir="auto"><br></div><div dir="auto">    instance MonadFail (Either [Char]) where</div><div dir="auto">      fail = Left</div><div dir="auto"><br></div><div dir="auto">That'll work today, and leave the question of the ultimate constraint open. It's not Haskell 2010, but no one can take advantage of that fact.</div><div dir="auto"><br></div><div dir="auto">I'm only raising that as an option; I don't really like it terribly much.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018, 3:05 AM Edward Kmett <<a href="mailto:ekmett@gmail.com">ekmett@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm also weakly inclined against it.<div><br></div><div>If we decided we really wanted something, then building a class that was just for this purpose might work, sort of an updated version of the old 'Error' class from transformers, but now limited to just the failure string so it has no extra baggage.</div><div><br></div><div>On the other hand, that then faces inertia problems all its own.</div><div><br></div><div>-Edward</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 24, 2018 at 11:42 PM David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank" rel="noreferrer">david.feuer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FWIW, I think I'm weakly opposed. Either is Haskell 98. MonadFail is<br>
solidly "standards-track" material, to the extent that designation is meaningful<br>
at the moment. IsString ... isn't.<br>
On Wed, Oct 24, 2018 at 10:44 PM Daniel Bergey <<a href="mailto:bergey@alum.mit.edu" target="_blank" rel="noreferrer">bergey@alum.mit.edu</a>> wrote:<br>
><br>
> Is there still consensus in favor of adding this instance?<br>
><br>
>  instance IsString str => MonadFail (Either str) where<br>
>     fail = Left . fromString<br>
><br>
> In 2016 there was some discussion, and my reading is that there was consensus in favor at the time:<br>
> Trac: <a href="https://ghc.haskell.org/trac/ghc/ticket/12160" rel="noreferrer noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/12160</a><br>
> libaries mailing list: <a href="https://mail.haskell.org/pipermail/libraries/2016-August/027248.html" rel="noreferrer noreferrer" target="_blank">https://mail.haskell.org/pipermail/libraries/2016-August/027248.html</a><br>
><br>
> Does anyone know of a later decision not to add it, or was it simply no one's top priority?<br>
><br>
> What is the next step to move this proposal forward?  Is more discussion in order?  Should I just submit a patch?<br>
><br>
> Thanks,<br>
> bergey<br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div></body></html>