summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Hakyll.hs
blob: af8c9c5f1a3266a1f96a12e88e7bf225f60620a9 (plain)
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
-- | Module describing the Hakyll monad stack.
module Text.Hakyll.Hakyll
    ( HakyllConfiguration (..)
    , Hakyll
    , askHakyll
    ) where

import Control.Monad.Reader (ReaderT, ask)
import Control.Monad (liftM)

import Text.Hakyll.Context (Context)

-- | Hakyll global configuration type.
data HakyllConfiguration = HakyllConfiguration
    { -- | An additional context to use when rendering. This additional context
      --   is used globally.
      additionalContext :: Context
    }

-- | Our custom monad stack.
type Hakyll = ReaderT HakyllConfiguration IO

-- | Simplified @ask@ function for the Hakyll monad stack.
askHakyll :: (HakyllConfiguration -> a) -> Hakyll a
askHakyll = flip liftM ask