@@ -11,6 +11,7 @@ module Hakyll.Core.Compiler
12 , requireAll
12 , requireAll
16import Prelude hiding ((.), id)
17import Prelude hiding ((.), id)
@@ -142,3 +143,9 @@ cached name (Compiler d j) = Compiler d $ const $ CompilerM $ do
142 Nothing -> error'
143 Nothing -> error'
144 error' = error "Hakyll.Core.Compiler.cached: Cache corrupt!"
145 error' = error "Hakyll.Core.Compiler.cached: Cache corrupt!"
147+-- | Create an unsafe compiler from a function in IO
149+unsafeCompiler :: (a -> IO b) -- ^ Function to lift
150+ -> Compiler a b -- ^ Resulting compiler
151+unsafeCompiler f = fromJob $ CompilerM . liftIO . f