From a20bc7bed9fd03e930297467f876c27f0072d1de Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 30 Dec 2012 09:50:02 +0100 Subject: Make saveSnapshot chainable --- src/Hakyll/Core/Compiler.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs index 9fec69b..16364c9 100644 --- a/src/Hakyll/Core/Compiler.hs +++ b/src/Hakyll/Core/Compiler.hs @@ -109,11 +109,14 @@ getResourceWith reader = do -------------------------------------------------------------------------------- +-- | Save a snapshot of the item. This function returns the same item, which +-- convenient for building '>>=' chains. saveSnapshot :: (Binary a, Typeable a) - => Internal.Snapshot -> Item a -> Compiler () + => Internal.Snapshot -> Item a -> Compiler (Item a) saveSnapshot snapshot item = do store <- compilerStore <$> compilerAsk compilerUnsafeIO $ Internal.saveSnapshot store snapshot item + return item -------------------------------------------------------------------------------- -- cgit v1.2.3