summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Lang <mlang@blind.guru>2020-11-16 16:10:35 +0100
committerGitHub <noreply@github.com>2020-11-16 18:10:35 +0300
commit850cf285897c22d2f8892695217a6085c2ce4875 (patch)
tree8d83aeb693cbb7ed79b010ad9496be0eca932c58
parent51d55b2577e2368980a912b2e029ca0d8f80079d (diff)
downloadhakyll-850cf285897c22d2f8892695217a6085c2ce4875.tar.gz
Derive Functor, Foldable and Traversable for Item (#815)
-rw-r--r--lib/Hakyll/Core/Item.hs19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/Hakyll/Core/Item.hs b/lib/Hakyll/Core/Item.hs
index e05df42..af15b94 100644
--- a/lib/Hakyll/Core/Item.hs
+++ b/lib/Hakyll/Core/Item.hs
@@ -2,6 +2,7 @@
-- | An item is a combination of some content and its 'Identifier'. This way, we
-- can still use the 'Identifier' to access metadata.
{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveTraversable #-}
module Hakyll.Core.Item
( Item (..)
, itemSetBody
@@ -25,23 +26,7 @@ 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
-
+ } deriving (Show, Typeable, Functor, Foldable, Traversable)
--------------------------------------------------------------------------------
instance Binary a => Binary (Item a) where