Say I have a dictionary.txt file, I need to read it into a map and use it in my program, how can I make this dictionary.txt file contained in the compiled exe f
You can use a custom Makefile/Setup.hs hook and invoke windres (if you're on Windows) or objcopy/elfrc (if you're on Linux) to compile resources to COFF/ELF objects which you can then combine with your Haskell object files to form the final executable. You can then access resources using Haskell FFI like this (not tested):
-- We have an image resource called "_imgdata"
foreign import ccall "&" _imgdata :: CString
-- Size of _imgdata is 405585 bytes.
imgdata :: CStringLen
imgdata = (_imgdata, 405585)
This solution will be more efficient than using file-embed (no CString -> ByteString conversions going on), but also more involved.
As an aside, I also ended up needing resource file support during my work on cabal-install, so it will probably be integrated into some future version of Cabal (if I'll implement it).