<p><br>
On Sep 7, 2012 2:00 AM, &quot;Edward Z. Yang&quot; &lt;<a href="mailto:ezyang@mit.edu">ezyang</a><a href="mailto:ezyang@mit.edu">@</a><a href="mailto:ezyang@mit.edu">mit.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; Haskell already does this, to some extent, in the design of imprecise<br>
&gt; exceptions.  But note that bottom *does* have well defined behavior, so<br>
&gt; these &quot;optimizations&quot; are not very desirable.</p>
<p>They&#39;re not *usually* desirable, but when the code has been proven not to fall into bottom, there doesn&#39;t seem to be much point in ensuring that things will work right if it does. This sort of thing only really makes sense when using Haskell as a compiler target.</p>

<p>&gt; Edward<br>
&gt;<br>
&gt; Excerpts from David Feuer&#39;s message of Thu Sep 06 19:35:<a href="tel:43%20-0400%202012">43 -0400 2012</a>:<br>
&gt; &gt; I have no plans to do such a thing anytime soon, but is there a way to tell<br>
&gt; &gt; GHC to allow nasal demons to fly if the program forces bottom? This mode of<br>
&gt; &gt; operation would seem to be a useful optimization when compiling a program<br>
&gt; &gt; produced by Coq or similar, enabling various transformations that can turn<br>
&gt; &gt; bottom into non-bottom, eliminating runtime checks in incomplete patterns,<br>
&gt; &gt; etc.</p>