summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Page.hs
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/Text/Hakyll/Page.hs
parentaaa777180948074f2d65a23aedc4f7fc7e3d4761 (diff)
downloadhakyll-d7f04a2c6d036363a6257f32409e86fb6112f6ac.tar.gz
Strictness cleanup.
Diffstat (limited to 'src/Text/Hakyll/Page.hs')
-rw-r--r--src/Text/Hakyll/Page.hs10
1 files changed, 3 insertions, 7 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