To embed some static files in a build, I'm using: https://hackage.haskell.org/package/file-embed-0.0.10.1/docs/Data-FileEmbed.html
It allows you to do:
MyFile.hs
myFile :: Data.ByteString.ByteString
myFile = $(embedFile "something/external.txt")
To embed files into the produced binary.
However, one irksome thing is that cabal doesn't know that a file using embedFile
depends on the file it loads (and therefore changes to something/external.txt
don't cause MyFile
to be re-built on build).
Is there any way to tell cabal about this dependency? The only solution I have now is to just touch
the Haskell file to cause it to be recompiled, but this is tedious.