1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
{-# LANGUAGE TemplateHaskell #-}
-- |
-- Module : Criterion.EmbeddedData
-- Copyright : (c) 2017 Ryan Scott
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- When the @embed-data-files@ @Cabal@ flag is enabled, this module exports
-- the contents of various files (the @data-files@ from @criterion.cabal@, as
-- well as a minimized version of Chart.js) embedded as a 'ByteString'.
module Criterion.EmbeddedData
( dataFiles
, chartContents
) where
import Data.ByteString (ByteString)
import Data.FileEmbed (embedDir, embedFile)
import Language.Haskell.TH.Syntax (runIO)
dataFiles :: [(FilePath, ByteString)]
dataFiles = $(embedDir "templates")
chartContents :: ByteString
chartContents = $(embedFile "/usr/share/javascript/chart.js/Chart.js")
|