summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-23 10:25:47 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-23 10:25:47 +0100
commitd7f04a2c6d036363a6257f32409e86fb6112f6ac (patch)
treeab9e2968f99bbf2354d6e87edc5fcd0d35f70b24 /src
parentaaa777180948074f2d65a23aedc4f7fc7e3d4761 (diff)
downloadhakyll-d7f04a2c6d036363a6257f32409e86fb6112f6ac.tar.gz
Strictness cleanup.
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