summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Page.hs
diff options
context:
space:
mode:
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