default instance for IsString

Joachim Breitner mail at
Wed Apr 25 22:57:34 CEST 2012


Am Mittwoch, den 25.04.2012, 11:15 +0300 schrieb Yitzchak Gale:
> 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.

another option, quick idea from a pub: Make OverloadedStrings work with
re-bindable syntax (←needs GHC change, probably) and redefine fromString
as you want. E.g, if you want to use alwas Text, just define

fromText :: String -> Text

in your module (and do not import the IsString method).


Joachim "nomeata" Breitner
  mail at  |  nomeata at  |  GPG: 0x4743206C
  xmpp: nomeata at |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Glasgow-haskell-users mailing list