default instance for IsString

Joachim Breitner mail at joachim-breitner.de
Wed Apr 25 22:57:34 CEST 2012


Hi,

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).

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
  mail at joachim-breitner.de  |  nomeata at debian.org  |  GPG: 0x4743206C
  xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/

-------------- 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: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20120425/d2b8c879/attachment.pgp>


More information about the Glasgow-haskell-users mailing list