Create a gist now

Instantly share code, notes, and snippets.

addDependentFile
module External where
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Lib
loadStringFromFile :: Q Exp
loadStringFromFile = do
let externalDependency = "external.txt"
qAddDependentFile externalDependency
s <- qRunIO $ readFile externalDependency
stringE s
Change Me!
-- main.hs
{-# LANGUAGE TemplateHaskell #-}
module Main where
import External (loadStringFromFile)
main :: IO ()
main = putStrLn $loadStringFromFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment