#5255: String literals cause runtime crashes when OverloadedStrings is in effect
---------------------------------+------------------------------------------
Reporter: YitzGale | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.0.3 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by YitzGale):
One issue to point out here is that my approach does not
allow polymorphic string literals.
We need a safe mechanism for string literals that includes
both `String` and `Text`. If that mechanism can allow other types
too, all the better, but it needs to be semantically sound.
If anyone strongly feels the need for runtime resolution of
string literals, which allows polymorphic literals but
also runtime crashes, that should be a separate mechanism.
It is interesting to note that this problem hasn't arisen in practice
for numeric literals. I think it is a combination of the difficulty of
writing a `Num` instance, the limited syntax of a numeric literal,
and the intuitive semantics of a number. Whereas for string literals,
it is just too tempting for people to abuse them as a poor man's
quasi-quoter, thus polluting the semantic space of literals
in Haskell.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5255#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs