File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import qualified Data.Text as Text
1717import Data.List.NonEmpty ( NonEmpty (.. ) )
1818import Data.Maybe ( mapMaybe )
1919import Language.Haskell.TH
20+ import Language.Haskell.TH.Syntax ( liftString )
2021import Language.Haskell.TH.Quote
2122import Nix.Atoms
2223import Nix.Expr
@@ -27,7 +28,12 @@ quoteExprExp s = do
2728 expr <- case parseNixText (Text. pack s) of
2829 Failure err -> fail $ show err
2930 Success e -> pure e
30- dataToExpQ (const Nothing `extQ` metaExp (freeVars expr)) expr
31+ dataToExpQ
32+ (const Nothing `extQ` metaExp (freeVars expr) `extQ` (Just . liftText))
33+ expr
34+ where
35+ liftText :: Text. Text -> Q Exp
36+ liftText txt = AppE (VarE 'Text. pack) <$> liftString (Text. unpack txt)
3137
3238quoteExprPat :: String -> PatQ
3339quoteExprPat s = do
You can’t perform that action at this time.
0 commit comments