@@ -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.
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.:
11+-- > $(embedFile "myfile.txt")
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:
17+-- > {-# LANGUAGE TemplateHaskell #-}
3module Data.FileEmbed
18module Data.FileEmbed
4 ( -- * Embed at compile time
19 ( -- * Embed at compile time