binembed-0.1.0.3: Embed data into object files.

CopyrightClaude Heiland-Allen 2010
Maintainerclaude@mathr.co.uk
Safe HaskellNone
LanguageHaskell98

Data.BinEmbed

Description

Support code used by the output of binembed --output-hs=.

For example, given MyData.binembed listing some files, you might get at the contents embedded into your executable using:

import MyData   -- which re-exports this module
main = do
  myData' <- unBinEmbed myData
  ...

See the 'binembed-example' package for a more detailed example.

Synopsis

Documentation

data Node a Source

A directory tree

Constructors

File a

A file has contents.

Dir (Map String (Node a))

A directory has named Nodes.

unBinEmbed :: Node (IO ByteString) -> IO (Node ByteString) Source

Unpack embedded data.

unBinEmbedFile :: Ptr () -> Ptr () -> IO ByteString Source

Repack the contents between two pointers. Your code probably doesn't need to call this, but it's needed in generated code.