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=
<br>
likely. =C2=A0Indeed misusing IsString is worse than your average partial<b=
r>
function because of the global nature of typeclasses and fromString<br>
being implicit. =C2=A0If that is indeed the core of the disagreement, then<=
br>
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>
<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<=
br>
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=
<br>
would complain to them to change their library, or use another<br>
library.<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=
s.nott.ac.uk">nhn at cs.nott.ac.uk</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt; Yitzhack Gale wrote:<br>
&gt;<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;<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;<br>
&gt; Presumably, the syntax of string literals as such is still going to be=
<br>
&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=
oadings?<br>
&gt; Or did I miss something central, here?<br>
&gt;<br>
&gt; Well, Haskell is not a total language, so the fact that &quot;fromStri=
ng&quot;<br>
&gt; might have non-total overloadings is not surprising. Yes,<br>
&gt; &quot;fromString&quot; would be implicitly inserted, just like e.g. &q=
uot;fromInteger&quot;<br>
&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=
r>
&gt; one.<br>
&gt;<br>
&gt; The benefit of an approach to overloading of string literals that is<b=
r>
&gt; analogous to the existing method for overloading of numeric literals<b=
r>
&gt; would seem to me to outweigh the benefits of additional static<br>
&gt; checking through an essentially new approach to overloading of literal=
s<br>
&gt; for a specific case.<br>
&gt;<br>
&gt; Best,<br>
&gt;<br>
&gt; /Henrik<br>
&gt;<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 cs.nott.ac.uk">nhn at cs.nott.ac.uk</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Glasgow-haskell-users mailing list<br>
&gt; <a href=3D"mailto:Glasgow-haskell-users at haskell.org">Glasgow-haskell-u=
sers at haskell.org</a><br>
&gt; <a href=3D"http://www.haskell.org/mailman/listinfo/glasgow-haskell-use=
rs" target=3D"_blank">http://www.haskell.org/mailman/listinfo/glasgow-haske=
ll-users</a><br>
<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href=3D"mailto:Glasgow-haskell-users at haskell.org">Glasgow-haskell-users@=
haskell.org</a><br>
<a href=3D"http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" t=
arget=3D"_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-us=
ers</a><br>
</div></div></blockquote></div><br></div>

--f46d043c81cc8ca3d004be70ca3c--



More information about the Glasgow-haskell-users mailing list