Wed May 27 11:08:40 PDT 2009 [email protected]
* Template Haskell: improve lifting for strings
Ignore-this: 296fa4ede64a87cc66b8c7af0e35b66f
When you have a (\s::String -> ....[| s |]....), the string
's' is lifted. We used to get a chain of single-character
Cons nodes, correct but lots and lots of code.
This patch arranges to optimise that to a string literal. It does
so in two places:
a) In TcExpr, if we know that s::String, we generate liftString directly
b) In DsMeta, if we find a list of character literals, we convert to
a string. This catches a few cases that (a) does not
There an accompanying patch in the template-haskell package,
adding Language.Haskell.TH.Syntax.liftString
M ./compiler/deSugar/DsMeta.hs -6 +11
M ./compiler/hsSyn/Convert.lhs -1 +19
M ./compiler/typecheck/TcExpr.lhs -4 +19
View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20090527180840-1287e-597ca6e9b13d3f062238d1b89d3e8d1fc1e4f4e7.gz
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc