summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Compiler.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-11-24 10:56:19 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-11-24 10:56:19 +0100
commit0a6b2b259862b90ccca11281de89091e2e01cb4d (patch)
tree9b4841724ad8d6d06df9682168c714cd3d3d7901 /src/Hakyll/Core/Compiler.hs
parentbc192a127b8c57ccb45ff6c773f5917fdbf7ec85 (diff)
downloadhakyll-0a6b2b259862b90ccca11281de89091e2e01cb4d.tar.gz
Add snapshots
Diffstat (limited to 'src/Hakyll/Core/Compiler.hs')
-rw-r--r--src/Hakyll/Core/Compiler.hs23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index c542ce7..94f1ef2 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -10,9 +10,16 @@ module Hakyll.Core.Compiler
, getResourceString
, getResourceLBS
, getResourceWith
- , require
- , requireBody
- , requireAll
+
+ , Internal.Snapshot
+ , saveSnapshot
+ , Internal.require
+ , Internal.requireSnapshot
+ , Internal.requireBody
+ , Internal.requireSnapshotBody
+ , Internal.requireAll
+ , Internal.requireAllSnapshots
+
, cached
, unsafeCompiler
, debugCompiler
@@ -30,7 +37,7 @@ import System.Environment (getProgName)
--------------------------------------------------------------------------------
import Hakyll.Core.Compiler.Internal
-import Hakyll.Core.Compiler.Require
+import qualified Hakyll.Core.Compiler.Require as Internal
import Hakyll.Core.Identifier
import Hakyll.Core.Item
import Hakyll.Core.Logger as Logger
@@ -94,6 +101,14 @@ getResourceWith reader = do
--------------------------------------------------------------------------------
+saveSnapshot :: (Binary a, Typeable a)
+ => Internal.Snapshot -> Item a -> Compiler ()
+saveSnapshot snapshot item = do
+ store <- compilerStore <$> compilerAsk
+ compilerUnsafeIO $ Internal.saveSnapshot store snapshot item
+
+
+--------------------------------------------------------------------------------
cached :: (Binary a, Typeable a)
=> String
-> Compiler a