diff options
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/Item.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Item.hs b/src/Hakyll/Core/Item.hs index 1f9af8e..ccf9e9a 100644 --- a/src/Hakyll/Core/Item.hs +++ b/src/Hakyll/Core/Item.hs @@ -5,6 +5,7 @@ module Hakyll.Core.Item ( Item (..) , itemSetBody + , itemM ) where @@ -39,3 +40,8 @@ instance Binary a => Binary (Item a) where -------------------------------------------------------------------------------- itemSetBody :: a -> Item b -> Item a itemSetBody x (Item i _) = Item i x + + +-------------------------------------------------------------------------------- +itemM :: Monad m => (a -> m b) -> Item a -> m (Item b) +itemM f (Item i b) = f b >>= \b' -> return (Item i b') |