summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Hakyll/Page.hs10
-rw-r--r--src/Text/Hakyll/Render/Internal.hs4
2 files changed, 5 insertions, 9 deletions
diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs
index 6ead0ae..9c319ba 100644
--- a/src/Text/Hakyll/Page.hs
+++ b/src/Text/Hakyll/Page.hs
@@ -13,7 +13,6 @@ import Data.Char (isSpace)
import Data.Maybe (fromMaybe)
import Control.Monad (liftM)
import Control.Monad.Reader (liftIO)
-import Control.Parallel.Strategies (rdeepseq, ($|))
import System.FilePath (takeExtension)
import System.IO
@@ -121,17 +120,14 @@ readPageFromFile path = do
(True : repeat False)
-- Read file.
- handle <- liftIO $ openFile path ReadMode
- sections <- fmap (splitAtDelimiters . lines )
- (liftIO $ hGetContents handle)
-
- let context = concat $ zipWith ($) sectionFunctions sections
+ contents <- liftIO $ readFile path
+ let sections = splitAtDelimiters $ lines $ contents
+ context = concat $ zipWith ($) sectionFunctions sections
page = fromContext $ M.fromList $
[ ("url", url)
, ("path", path)
] ++ context
- seq (($|) id rdeepseq context) $ liftIO $ hClose handle
return page
where
url = toURL path
diff --git a/src/Text/Hakyll/Render/Internal.hs b/src/Text/Hakyll/Render/Internal.hs
index 51eecc7..27459ad 100644
--- a/src/Text/Hakyll/Render/Internal.hs
+++ b/src/Text/Hakyll/Render/Internal.hs
@@ -11,11 +11,11 @@ module Text.Hakyll.Render.Internal
import qualified Data.Map as M
import Text.Hakyll.Context (Context, ContextManipulation)
+import Control.DeepSeq (deepseq)
import Control.Monad.Reader (liftIO)
import Data.List (isPrefixOf, foldl')
import Data.Char (isAlphaNum)
import Data.Maybe (fromMaybe)
-import Control.Parallel.Strategies (rdeepseq, ($|))
import Text.Hakyll.Renderable
import Text.Hakyll.Page
@@ -57,7 +57,7 @@ pureRenderWith manipulation template context =
let contextIgnoringRoot = M.insert "root" "$root" (manipulation context)
body = regularSubstitute template contextIgnoringRoot
-- Force the body to be rendered.
- in ($|) id rdeepseq (M.insert "body" body context)
+ in body `deepseq` M.insert "body" body context
-- | A pure renderAndConcat function.
pureRenderAndConcatWith :: ContextManipulation