-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Inclusion of files in executables at compile-time. -- -- Inclusion of files in source code via Template Haskell. -- -- When distributing executables, sometimes it is required to attach some -- other resources in files. Using this library (together with the -- TemplateHaskell extension) you avoid this problem by including those -- files inside the executable at compile time. @package include-file @version 0.1.0.3 -- | Inclusion of files in source code via Template Haskell. -- -- When distributing executables, sometimes it is required to attach some -- other resources in files. Using includeFileInSource you avoid -- this problem by including those files inside the executable at compile -- time. -- --
-- {-# LANGUAGE TemplateHaskell #-}
--
-- import Development.IncludeFile
--
-- $(includeFileInSource "foo.png" "myImage")
--
--
-- This defines the myImage value with type ByteString
-- and with the content of the file foo.png.
--
-- -- import Data.ByteString.Lazy (ByteString,pack) -- import Development.IncludeFile (includeFileInSource,Word8) ---- -- Needless to say, if you have already imported any of those entities, -- you don't have to do it again. -- --
-- benchmarking include-file -- time 1.814 ns (1.799 ns .. 1.826 ns) -- 1.000 R² (0.999 R² .. 1.000 R²) -- mean 1.808 ns (1.797 ns .. 1.819 ns) -- std dev 37.48 ps (31.27 ps .. 46.78 ps) -- -- benchmarking read-file -- time 4.869 μs (4.798 μs .. 4.938 μs) -- 0.998 R² (0.998 R² .. 0.999 R²) -- mean 4.911 μs (4.857 μs .. 4.968 μs) -- std dev 178.8 ns (150.1 ns .. 212.5 ns) ---- --