git.iko.soy/typeable/file-embed
on master help sign in
Some docs
3d21ff3Michael Snoyman
Data/FileEmbed.hs+15
@@ -1,5 +1,20 @@
1{-# LANGUAGE TemplateHaskell #-}
1{-# LANGUAGE TemplateHaskell #-}
2{-# LANGUAGE CPP #-}
2{-# LANGUAGE CPP #-}
3+-- | This module uses template Haskell. Following is a simplified explanation of usage for those unfamiliar with calling Template Haskell functions.
4+--
5+-- The function @embedFile@ in this modules embeds a file into the exceutable
6+-- that you can use it at runtime. A file is represented as a @ByteString@.
7+-- However, as you can see below, the type signature indicates a value of type
8+-- @Q Exp@ will be returned. In order to convert this into a @ByteString@, you
9+-- must use Template Haskell syntax, e.g.:
10+--
11+-- > $(embedFile "myfile.txt")
12+--
13+-- This expression will have type @ByteString@. Be certain to enable the
14+-- TemplateHaskell language extension, usually by adding the following to the
15+-- top of your module:
16+--
17+-- > {-# LANGUAGE TemplateHaskell #-}
3module Data.FileEmbed
18module Data.FileEmbed
4 ( -- * Embed at compile time
19 ( -- * Embed at compile time
5 embedFile
20 embedFile
file-embed.cabal+1−1
@@ -1,5 +1,5 @@
1name: file-embed
1name: file-embed
2−version: 0.0.4.7
2+version: 0.0.4.8
3license: BSD3
3license: BSD3
4license-file: LICENSE
4license-file: LICENSE
5author: Michael Snoyman <michael@snoyman.com>
5author: Michael Snoyman <michael@snoyman.com>