Safe Haskell | None |
---|---|
Language | Haskell2010 |
Embed files as ByteStrings into an executable
Synopsis
- bufferToByteString :: Buffer mut pin NotFinalized External -> ByteString
- embedBS :: ByteString -> Q Exp
- embedBSFile :: FilePath -> Q Exp
- embedBSFilePrefix :: FilePath -> FilePath -> Q Exp
- embedBSOneFileOf :: [FilePath] -> Q Exp
- embedBSDir :: FilePath -> Q Exp
- module Haskus.Memory.Embed
Documentation
bufferToByteString :: Buffer mut pin NotFinalized External -> ByteString Source #
Convert an external buffer into a ByteString (O(1))
embedBSFile :: FilePath -> Q Exp Source #
Embed a single file in your source code.
import qualified Data.ByteString myFile :: Data.ByteString.ByteString myFile = $(embedFile "dirName/fileName")
embedBSOneFileOf :: [FilePath] -> Q Exp Source #
Embed a single existing file in your source code out of list a list of paths supplied.
import qualified Data.ByteString myFile :: Data.ByteString.ByteString myFile = $(embedOneFileOf [ "dirName/fileName", "src/dirName/fileName" ])
embedBSDir :: FilePath -> Q Exp Source #
Embed a directory recursively in your source code.
import qualified Data.ByteString myDir :: [(FilePath, Data.ByteString.ByteString)] myDir = $(embedDir "dirName")
module Haskus.Memory.Embed