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