Initialize function by file contents at compile time

Viewed 216

Is there a way to initialize a function

someText :: Text

which value will be stored in a file available at compile time?

I thought I could use TH for that, but for now I just found

embedFile :: FilePath -> Q Exp
runQ :: Quasi m => Q a -> m a

I can only unwrap Q into IO:

instance Quasi IO    
instance Quasi Q

I guess I need Identity instance of Quasi, but there is no one.

2 Answers
Related