<p dir="ltr">+1 also improves the correctness of the monad laws</p>
<div class="gmail_quote">On Jun 10, 2015 7:46 AM, "Roman Cheplyaka" <<a href="mailto:roma@ro-che.info">roma@ro-che.info</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/06/15 14:22, Johan Tibell wrote:<br>
> On Wed, Jun 10, 2015 at 12:42 AM, David Luposchainsky<br>
> <<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a> <mailto:<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>>><br>
> wrote:<br>
><br>
> I think there are two important consequences of MonadFail. First of<br>
> all, we can<br>
> all safely write failable patterns if we so desire. Second, the<br>
> compiler can<br>
> ensure other people's codebases do not lie to us (knowingly or<br>
> unknowingly).<br>
><br>
><br>
> The second is a bit overstated I think. Any function you call can still<br>
> have partial pattern matches in all the other places Haskell allows them<br>
> and you wouldn't know from the type.<br>
<br>
For most of them, at least you get a warning from GHC (not for patterns<br>
inside lambda, sadly, although that should be fixable). But for<br>
<br>
do<br>
Just x <- a<br>
...<br>
<br>
it's not possible in principle to give a warning, because it's not clear<br>
whether the implicit call to fail is intended.<br>
<br>
Roman<br>
<br>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div>