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't think it'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'd say *easily* partial since someone pointed out the UTF8<br>
fromString is partial, but it's pretty hard to type bad UTF8<br>
accidentally so it doesn't seem so bad to me.<br>
<br>
If we agree that 'fromString :: String -> XML' is a bad idea, th=
en can<br>
we just say "so don't do that then"? =C2=A0Safety is good but=
there'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'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 <<a href=3D"mailto:nhn at c=
s.nott.ac.uk">nhn at cs.nott.ac.uk</a>> wrote:<br>
> Hi,<br>
><br>
><br>
> Yitzhack Gale wrote:<br>
><br>
>> Wouldn't it be ironic if the one thing that every language<br>
>> other than Haskell is able to check at compile time,<br>
>> namely the static syntax of string literals, could only be<br>
>> checked at run time in Haskell?<br>
><br>
> I don't really see the irony, I'm afraid, as nothing really<br=
>
> has changed, and as Simon M. that I don't see what the<br>
> fuss is about.<br>
><br>
> Presumably, the syntax of string literals as such is still going to be=
<br>
> checked by the scanner, as it always was? And the issue, then, is<br>
> whether an overloaded "fromString" is total in all its overl=
oadings?<br>
> Or did I miss something central, here?<br>
><br>
> Well, Haskell is not a total language, so the fact that "fromStri=
ng"<br>
> might have non-total overloadings is not surprising. Yes,<br>
> "fromString" would be implicitly inserted, just like e.g. &q=
uot;fromInteger"<br>
> for overloaded integer literals, to create the effect of overloaded<br=
>
> literals, but this is really just a convenience, albeit an important<b=
r>
> one.<br>
><br>
> The benefit of an approach to overloading of string literals that is<b=
r>
> analogous to the existing method for overloading of numeric literals<b=
r>
> would seem to me to outweigh the benefits of additional static<br>
> checking through an essentially new approach to overloading of literal=
s<br>
> for a specific case.<br>
><br>
> Best,<br>
><br>
> /Henrik<br>
><br>
> --<br>
> Henrik Nilsson<br>
> School of Computer Science<br>
> The University of Nottingham<br>
> <a href=3D"mailto:nhn at cs.nott.ac.uk">nhn at cs.nott.ac.uk</a><br>
><br>
><br>
> _______________________________________________<br>
> Glasgow-haskell-users mailing list<br>
> <a href=3D"mailto:Glasgow-haskell-users at haskell.org">Glasgow-haskell-u=
sers at haskell.org</a><br>
> <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