diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Hakyll/RenderAction.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Text/Hakyll/RenderAction.hs b/src/Text/Hakyll/RenderAction.hs index e458eac..a5a6f26 100644 --- a/src/Text/Hakyll/RenderAction.hs +++ b/src/Text/Hakyll/RenderAction.hs @@ -11,6 +11,7 @@ module Text.Hakyll.RenderAction , Renderable ) where +import Control.Arrow import Control.Category import Control.Monad ((<=<), mplus, unless) import Control.Monad.Reader (liftIO) @@ -96,3 +97,13 @@ instance Category RenderAction where , actionUrl = actionUrl y `mplus` actionUrl x , actionFunction = actionFunction x <=< actionFunction y } + +instance Arrow RenderAction where + arr f = id { actionFunction = \x -> return (f x) } + + first x = RenderAction + { actionDependencies = actionDependencies x + , actionUrl = actionUrl x + , actionFunction = \(y, z) -> do y' <- (actionFunction x) y + return (y', z) + } |