diff --git a/src/System/FilePath/Glob/TH.hs b/src/System/FilePath/Glob/TH.hs index 25df6a0ac..3a39521d9 100644 --- a/src/System/FilePath/Glob/TH.hs +++ b/src/System/FilePath/Glob/TH.hs @@ -21,13 +21,13 @@ import qualified Data.Map.Strict as Map deriving instance Lift CompOptions -patternFile' :: CompOptions -> FilePath -> TExpQ (Map Text Pattern) -patternFile' opts file = do +patternFile' :: CompOptions -> FilePath -> Code Q (Map Text Pattern) +patternFile' opts file = liftCode $ do qAddDependentFile file patternStrings <- runIO $ filter (not . isComment) . Text.lines <$> Text.readFile file unsafeTExpCoerce . appE [e|Map.fromList|] . listE $ map (\pat'@(Text.unpack -> pat) -> [e|(pat', compileWith opts pat)|]) patternStrings -patternFile :: CompOptions -> FilePath -> TExpQ [Pattern] +patternFile :: CompOptions -> FilePath -> Code Q [Pattern] patternFile opts file = [||Map.elems $$(patternFile' opts file)||] isComment :: Text -> Bool