<p>I think Ghc does allow catching pure exceptions. </p>
<div class="gmail_quote">Am 07.06.2011 17:53 schrieb &quot;Yitzchak Gale&quot; &lt;<a href="mailto:gale@sefer.org">gale@sefer.org</a>&gt;:<br type="attribution">&gt; I wrote:<br>&gt;&gt;&gt;&gt; I noticed when looking at the IsString instance<br>
&gt;&gt;&gt;&gt; for Name: it can introduce crashes into a program if someone<br>&gt;&gt;&gt;&gt; accidentally puts a &#39;{&#39; at the beginning of a Name string.<br>&gt;&gt; Or accidentally omits the &#39;}&#39; in Clark notation.<br>
&gt;&gt; The way xml-types is now, it cannot be used in an<br>&gt;&gt; environment where code is not allowed to introduce<br>&gt;&gt; any additional risk of crashes. That is quite common in<br>&gt;&gt; commercial development.<br>
&gt; <br>&gt; John Millikin wrote:<br>&gt;&gt; The code won&#39;t ever *crash*, it will merely throw an exception,<br>&gt;&gt; which can be caught...<br>&gt;&gt; Second, GHC&#39;s IsString feature is not enabled by default...<br>
&gt;&gt; Third, the IsString instance is largely for convenience...<br>&gt; <br>&gt; Sorry, I guess I really wasn&#39;t making myself clear.<br>&gt; <br>&gt; I never raised any doubts about it being *possible*, or even<br>
&gt; easy, to write safe code using the xml-types library as it<br>&gt; is now.<br>&gt; <br>&gt; In a large-scale software development environment, one way<br>&gt; that risk is evaluated is by counting the number of ways that it<br>
&gt; is *possible* for a library to cause a crash. And yes, in this<br>&gt; context raising an asynchronous exception that knocks your<br>&gt; program all the way out to some last-chance exception<br>&gt; handler in the outer IO layer counts as a crash.<br>
&gt; <br>&gt; Since the whole idea of xml-types is for it to be a<br>&gt; unifying standard, I&#39;d like to see it usable in that kind<br>&gt; of environment, too.<br>&gt; <br>&gt; In addition, I have already pointed out that semantically<br>
&gt; it doesn&#39;t make sense for a fromString implementation<br>&gt; to return _|_. And it is easy to make a small change<br>&gt; to the current implementation to avoid that.<br>&gt; <br>&gt; So let me turn the question around. Is there a compelling<br>
&gt; reason why, in some use case, the fromString must<br>&gt; return _|_, rather than returning some text that will allow<br>&gt; the application to handle the situation itself?<br>&gt; <br>&gt; Thanks,<br>&gt; Yitz<br>&gt; <br>
&gt; _______________________________________________<br>&gt; web-devel mailing list<br>&gt; <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>&gt; <a href="http://www.haskell.org/mailman/listinfo/web-devel">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
</div>