summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-26 15:49:11 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-26 15:49:11 +0100
commit5c454fc2ced8364e000f8c9cc36387e39e001714 (patch)
tree59630d5dd2e19162cccba2381b54a2d052b49bd5 /src/Hakyll/Core
parented12fd21200bad030eeb8d2ccf2d0acdbdc73949 (diff)
downloadhakyll-5c454fc2ced8364e000f8c9cc36387e39e001714.tar.gz
Fix $body$ bug, add `traceShowCompiler`
Diffstat (limited to 'src/Hakyll/Core')
-rw-r--r--src/Hakyll/Core/Compiler.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index a3fed7c..e5da9b8 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -101,6 +101,7 @@ module Hakyll.Core.Compiler
, requireAllA
, cached
, unsafeCompiler
+ , traceShowCompiler
, mapCompiler
, timedCompiler
, byExtension
@@ -277,6 +278,14 @@ unsafeCompiler :: (a -> IO b) -- ^ Function to lift
-> Compiler a b -- ^ Resulting compiler
unsafeCompiler f = fromJob $ CompilerM . liftIO . f
+-- | Compiler for debugging purposes
+--
+traceShowCompiler :: Show a => Compiler a a
+traceShowCompiler = fromJob $ \x -> CompilerM $ do
+ logger <- compilerLogger <$> ask
+ report logger $ show x
+ return x
+
-- | Map over a compiler
--
mapCompiler :: Compiler a b