default instance for IsString

Yitzchak Gale gale at
Wed Apr 25 10:15:41 CEST 2012

Hi Simon,

First of all, I'm sorry if I'm coming off as too combative,
as Greg says. That is certainly not my intention.
I'm not asking for any free work from you, either.

The only reason I don't like using OverloadedStrings
for typing string literals as Text and ByteString
is that when you turn on OverloadedStrings, you turn
it on for all types, not just Text and ByteString.
I don't want to be forced to do that. Because
all other uses of OverloadedStrings that I have
seen, and there are many, are ill-advised in my
opinion. They all should have been quasiquoters.

If it's really important to use this mechanism
for typing string literals as Text and ByteString,
how about this:

Create a new class IsBuiltinString, with method
isBuiltinString. Make it hidden so that no new
instances can be defined outside of base, and
provide instances only for String, Text, and
ByteString, for now. Then I will happily use the
OverloadedBuiltinStrings extension. People who
don't see any problem with OverloadedStrings
can go on using it as before.


More information about the Glasgow-haskell-users mailing list