<div>The bigger issue here is one&#39;s own reasoning about the code, never mind the compiler&#39;s. Bob Harper writes eloquently on this topic:</div><div><div><br></div><div><div class="f kv" style="color:rgb(102,102,102);margin-bottom:1px;font-family:arial,sans-serif;line-height:15px;background-color:rgb(255,255,255)">

<cite style="color:rgb(0,153,51);font-style:normal"><a href="http://existentialtype.wordpress.com/2011/03/15/">http://existentialtype.wordpress.com/2011/03/15/</a><b>boolean</b>-blindness/</cite></div><span class="st" style="line-height:1.24;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"></span><div>

<br></div><div>As for optimality issues, a naive compiler would wastefully examine the tag twice in the else clause of:</div><div><br></div><div>if isNothing mExp<br>  then expr<br>  else f (fromJust mExp)<br></div><div>
<br>
</div><div><br></div><div>-- Kim-Ee</div>
<br><br><div class="gmail_quote">On Fri, Oct 12, 2012 at 3:48 AM, Christopher Howard <span dir="ltr">&lt;<a href="mailto:christopher.howard@frigidcode.com" target="_blank">christopher.howard@frigidcode.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Point of curiosity: Does an error in a Haskell program have a negative<br>
impact on the compilers reasoning about or optimization of the code,<br>
even if said error is never reached in the control flow? For example,<br>
both of the following would have the same result:<br>
<br>
code:<br>
--------<br>
case mExp of<br>
  Nothing -&gt; expr<br>
  Just x -&gt; f x<br>
<br>
-- or...<br>
<br>
if isNothing mExp<br>
  then expr<br>
  else f (fromJust mExp)<br>
--------<br>
<br>
In my naive reasoning, I would think that in the latter case the use of<br>
fromJust introduces, from the compilers perspective, an additional<br>
possible outcome (an error being thrown). This presumably would<br>
complicate the compilers reasoning about the code, unless of course the<br>
compiler is smart enough to figure out that the error will never be reached.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<a href="http://frigidcode.com" target="_blank">frigidcode.com</a><br>
<a href="http://indicium.us" target="_blank">indicium.us</a><br>
<br>
</font></span><br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div></div>