diff options
author | Mario Lang <mlang@blind.guru> | 2020-11-16 16:10:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 18:10:35 +0300 |
commit | 850cf285897c22d2f8892695217a6085c2ce4875 (patch) | |
tree | 8d83aeb693cbb7ed79b010ad9496be0eca932c58 /lib/Hakyll/Core | |
parent | 51d55b2577e2368980a912b2e029ca0d8f80079d (diff) | |
download | hakyll-850cf285897c22d2f8892695217a6085c2ce4875.tar.gz |
Derive Functor, Foldable and Traversable for Item (#815)
Diffstat (limited to 'lib/Hakyll/Core')
-rw-r--r-- | lib/Hakyll/Core/Item.hs | 19 |
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 |