default instance for IsString

Markus Läll markus.l2ll at
Tue Apr 24 12:53:42 CEST 2012

But if you want a string to be, say, an XML document then you want to
turn the string literal into an XML syntax tree (which is correct by
the definition of the data types representing it). As this conversion
can fail (all unicode strings are not valid representations of an XML
syntax tree), you need to compile-time parse it. As you will need a
compile-time parser for all such languages, then TH is the only
reasonable choice -- or isn't it?

On Tue, Apr 24, 2012 at 12:35 PM, Yitzchak Gale <gale at> wrote:
> Markus Läll wrote:
>> You do know, that you already *can* have safe Text and ByteString from
>> an overloaded string literal.
> Yes, the IsString instances for Text and ByteString are safe
> (I hope).
> But in order to use them, I have to turn on OverloadedStrings.
> That could cause other string literals in the same module
> to throw exceptions at run time.
> -Yitz

Markus Läll

More information about the Glasgow-haskell-users mailing list