data-embed-0.1.0.0: Embed files and other binary blobs inside executables without Template Haskell.

Safe HaskellNone
LanguageHaskell2010

Data.Embed

Description

This module provides access to files bundled with the current executable. To bundle files within an executable, use the accompanying embedtool command line tool, or the functions provided in Data.Embed.File.

To embed a directory of data files with an executable, try:

embedtool -p1 -w my_executable my_data_dir

Synopsis

Documentation

myBundle :: Bundle Source

Handle to this application's embedded file bundle. Throws an error upon evaluation if the application has none.

embeddedFile :: FilePath -> Maybe ByteString Source

Returns the specified embedded file, or Nothing if it does not exist or this executable has no embedded file bundle.

embeddedFile' :: FilePath -> ByteString Source

Like embeddedFile, but throws an error if the given file does not exist in the executable's embedded file bundle.