<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 10, 2015 at 1:46 PM, Roman Cheplyaka <span dir="ltr"><<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/06/15 14:22, Johan Tibell wrote:<br>
> On Wed, Jun 10, 2015 at 12:42 AM, David Luposchainsky<br>
</span>> <<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a> <mailto:<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>>><br>
<span class="">> 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>
</span>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></blockquote><div><br></div><div>That's a good point. An alternative to changing fail would to add a warning for partial matches even in do-notation.</div><div> </div></div></div></div>