mirror of
https://github.com/typeable/file-embed.git
synced 2024-09-11 07:45:30 +03:00
Some docs
This commit is contained in:
parent
5f9df52bc8
commit
3d21ff3618
@ -1,5 +1,20 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- | This module uses template Haskell. Following is a simplified explanation of usage for those unfamiliar with calling Template Haskell functions.
|
||||
--
|
||||
-- The function @embedFile@ in this modules embeds a file into the exceutable
|
||||
-- that you can use it at runtime. A file is represented as a @ByteString@.
|
||||
-- However, as you can see below, the type signature indicates a value of type
|
||||
-- @Q Exp@ will be returned. In order to convert this into a @ByteString@, you
|
||||
-- must use Template Haskell syntax, e.g.:
|
||||
--
|
||||
-- > $(embedFile "myfile.txt")
|
||||
--
|
||||
-- This expression will have type @ByteString@. Be certain to enable the
|
||||
-- TemplateHaskell language extension, usually by adding the following to the
|
||||
-- top of your module:
|
||||
--
|
||||
-- > {-# LANGUAGE TemplateHaskell #-}
|
||||
module Data.FileEmbed
|
||||
( -- * Embed at compile time
|
||||
embedFile
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: file-embed
|
||||
version: 0.0.4.7
|
||||
version: 0.0.4.8
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
|
Loading…
Reference in New Issue
Block a user