From: simonpj@microsoft.com Date: Fri, 30 Jul 2010 13:19:22 +0000 (+0000) Subject: * Add StringPrimL as a constructor for Template Haskell (Trac #4168) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=70249b050422f2abba670e5fdb3c5853ceeb662c;p=ghc-hetmet.git * 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 --- 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