summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Item.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2017-06-19 11:57:23 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2017-06-19 11:57:23 +0200
commit67ecff7ad383640bc73d64edc2506c7cc648a134 (patch)
tree6d328e43c3ab86c29a2d775fabaa23618c16fb51 /src/Hakyll/Core/Item.hs
parent2df3209bafa08e6b77ee4a8598fc503269513527 (diff)
downloadhakyll-67ecff7ad383640bc73d64edc2506c7cc648a134.tar.gz
Move src/ to lib/, put Init.hs in src/
Diffstat (limited to 'src/Hakyll/Core/Item.hs')
-rw-r--r--src/Hakyll/Core/Item.hs63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/Hakyll/Core/Item.hs b/src/Hakyll/Core/Item.hs
deleted file mode 100644
index e05df42..0000000
--- a/src/Hakyll/Core/Item.hs
+++ /dev/null
@@ -1,63 +0,0 @@
---------------------------------------------------------------------------------
--- | An item is a combination of some content and its 'Identifier'. This way, we
--- can still use the 'Identifier' to access metadata.
-{-# LANGUAGE DeriveDataTypeable #-}
-module Hakyll.Core.Item
- ( Item (..)
- , itemSetBody
- , withItemBody
- ) where
-
-
---------------------------------------------------------------------------------
-import Data.Binary (Binary (..))
-import Data.Foldable (Foldable (..))
-import Data.Typeable (Typeable)
-import Prelude hiding (foldr)
-
-
---------------------------------------------------------------------------------
-import Hakyll.Core.Compiler.Internal
-import Hakyll.Core.Identifier
-
-
---------------------------------------------------------------------------------
-data Item a = Item
- { itemIdentifier :: Identifier
- , itemBody :: a
- } deriving (Show, Typeable)
-
-
---------------------------------------------------------------------------------
-instance Functor Item where
- fmap f (Item i x) = Item i (f x)
-
-
---------------------------------------------------------------------------------
-instance Foldable Item where
- foldr f z (Item _ x) = f x z
-
-
---------------------------------------------------------------------------------
-instance Traversable Item where
- traverse f (Item i x) = Item i <$> f x
-
-
---------------------------------------------------------------------------------
-instance Binary a => Binary (Item a) where
- put (Item i x) = put i >> put x
- get = Item <$> get <*> get
-
-
---------------------------------------------------------------------------------
-itemSetBody :: a -> Item b -> Item a
-itemSetBody x (Item i _) = Item i x
-
-
---------------------------------------------------------------------------------
--- | Perform a compiler action on the item body. This is the same as 'traverse',
--- but looks less intimidating.
---
--- > withItemBody = traverse
-withItemBody :: (a -> Compiler b) -> Item a -> Compiler (Item b)
-withItemBody = traverse