* Add StringPrimL as a constructor for Template Haskell (Trac #4168)
authorsimonpj@microsoft.com <unknown>
Fri, 30 Jul 2010 13:19:22 +0000 (13:19 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 30 Jul 2010 13:19:22 +0000 (13:19 +0000)
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

index 2a4fa72..d392be2 100644 (file)
@@ -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