git.iko.soy/typeable/file-embed
on master help sign in
Some docs
commit3d21ff36182ec6da4e2e12ba8a8747cc04707359 authorMichael Snoyman <michael@snoyman.com> dateMon 3 Jun 2013, 16:18 (13 years ago) parent5f9df52
2 files changed+16−1
Data/FileEmbed.hs+15 file-embed.cabal+1−1
Data/FileEmbed.hs+15
@@ -1,5 +1,20 @@
11{-# LANGUAGE TemplateHaskell #-}
22{-# 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 #-}
318module Data.FileEmbed
419 ( -- * Embed at compile time
520 embedFile
file-embed.cabal+1−1
@@ -1,5 +1,5 @@
11name: file-embed
2−version: 0.0.4.7
2+version: 0.0.4.8
33license: BSD3
44license-file: LICENSE
55author: Michael Snoyman <michael@snoyman.com>