From 70249b050422f2abba670e5fdb3c5853ceeb662c Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Fri, 30 Jul 2010 13:19:22 +0000 Subject: [PATCH] * Add StringPrimL as a constructor for Template Haskell (Trac #4168) There are already constructors for IntPrim, FloatPrim etc, so this makes it more uniform. There's a corresponding patch for the TH library --- compiler/hsSyn/Convert.lhs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs index 2a4fa72..d392be2 100644 --- a/compiler/hsSyn/Convert.lhs +++ b/compiler/hsSyn/Convert.lhs @@ -589,11 +589,12 @@ cvtLit (WordPrimL w) = do { force w; return $ HsWordPrim w } cvtLit (FloatPrimL f) = do { force f; return $ HsFloatPrim f } cvtLit (DoublePrimL f) = do { force f; return $ HsDoublePrim f } cvtLit (CharL c) = do { force c; return $ HsChar c } -cvtLit (StringL s) - = do { let { s' = mkFastString s } - ; force s' - ; return $ HsString s' - } +cvtLit (StringL s) = do { let { s' = mkFastString s } + ; force s' + ; return $ HsString s' } +cvtLit (StringPrimL s) = do { let { s' = mkFastString s } + ; force s' + ; return $ HsStringPrim s' } cvtLit _ = panic "Convert.cvtLit: Unexpected literal" -- cvtLit should not be called on IntegerL, RationalL -- That precondition is established right here in -- 1.7.10.4