Added Arrow implementation for RenderAction.
This commit is contained in:
parent
4756b82329
commit
0204dd678a
1 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue