No subject

Sun Oct 23 10:51:38 CEST 2011

believe fromString will tempt misuse (i.e. using *easily* partial<br>
functions, like XML validation), while others don&#39;t think it&#39;s that=
likely. =C2=A0Indeed misusing IsString is worse than your average partial<b=
function because of the global nature of typeclasses and fromString<br>
being implicit. =C2=A0If that is indeed the core of the disagreement, then<=
can we at least agree that writing a partial fromString is a bad idea?<br>
=C2=A0I&#39;d say *easily* partial since someone pointed out the UTF8<br>
fromString is partial, but it&#39;s pretty hard to type bad UTF8<br>
accidentally so it doesn&#39;t seem so bad to me.<br>
If we agree that &#39;fromString :: String -&gt; XML&#39; is a bad idea, th=
en can<br>
we just say &quot;so don&#39;t do that then&quot;? =C2=A0Safety is good but=
 there&#39;s a<br>
point where you have to trust people with the sharp tools. =C2=A0Suppose a<=
library author adding a fromString for regexes that crashes on<br>
unbalanced parens. =C2=A0If it&#39;s a problem in practice I imagine people=
would complain to them to change their library, or use another<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
On Tue, Apr 24, 2012 at 9:10 AM, Henrik Nilsson &lt;<a href=3D"mailto:nhn at c=">nhn at</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt; Yitzhack Gale wrote:<br>
&gt;&gt; Wouldn&#39;t it be ironic if the one thing that every language<br>
&gt;&gt; other than Haskell is able to check at compile time,<br>
&gt;&gt; namely the static syntax of string literals, could only be<br>
&gt;&gt; checked at run time in Haskell?<br>
&gt; I don&#39;t really see the irony, I&#39;m afraid, as nothing really<br=
&gt; has changed, and as Simon M. that I don&#39;t see what the<br>
&gt; fuss is about.<br>
&gt; Presumably, the syntax of string literals as such is still going to be=
&gt; checked by the scanner, as it always was? And the issue, then, is<br>
&gt; whether an overloaded &quot;fromString&quot; is total in all its overl=
&gt; Or did I miss something central, here?<br>
&gt; Well, Haskell is not a total language, so the fact that &quot;fromStri=
&gt; might have non-total overloadings is not surprising. Yes,<br>
&gt; &quot;fromString&quot; would be implicitly inserted, just like e.g. &q=
&gt; for overloaded integer literals, to create the effect of overloaded<br=
&gt; literals, but this is really just a convenience, albeit an important<b=
&gt; one.<br>
&gt; The benefit of an approach to overloading of string literals that is<b=
&gt; analogous to the existing method for overloading of numeric literals<b=
&gt; would seem to me to outweigh the benefits of additional static<br>
&gt; checking through an essentially new approach to overloading of literal=
&gt; for a specific case.<br>
&gt; Best,<br>
&gt; /Henrik<br>
&gt; --<br>
&gt; Henrik Nilsson<br>
&gt; School of Computer Science<br>
&gt; The University of Nottingham<br>
&gt; <a href=3D"mailto:nhn at">nhn at</a><br>
&gt; _______________________________________________<br>
&gt; Glasgow-haskell-users mailing list<br>
&gt; <a href=3D"mailto:Glasgow-haskell-users at">Glasgow-haskell-u=
sers at</a><br>
&gt; <a href=3D"
rs" target=3D"_blank">
Glasgow-haskell-users mailing list<br>
<a href=3D"mailto:Glasgow-haskell-users at">Glasgow-haskell-users@=</a><br>
<a href=3D"" t=


More information about the Glasgow-haskell-users mailing list