hakyll-4.9.8.0: A static website compiler library

Safe Haskell | None
Language | Haskell98

Hakyll.Core.Item

Description

An item is a combination of some content and its `Identifier`. This way, we can still use the `Identifier` to access metadata.

Synopsis

- data Item a = Item {
  - itemIdentifier :: Identifier
  - itemBody :: a
  }
- itemSetBody :: a -> Item b -> Item a
- withItemBody :: (a -> Compiler b) -> Item a -> Compiler (Item b)

# Documentation

data Item a #

Constructors

Item |
Fields itemIdentifier :: Identifier itemBody :: a

Instances

Functor Item # |
Methods fmap :: (a -> b) -> Item a -> Item b # (<$) :: a -> Item b -> Item a #
Foldable Item # |
Methods fold :: Monoid m => Item m -> m # foldMap :: Monoid m => (a -> m) -> Item a -> m # foldr :: (a -> b -> b) -> b -> Item a -> b # foldr' :: (a -> b -> b) -> b -> Item a -> b # foldl :: (b -> a -> b) -> b -> Item a -> b # foldl' :: (b -> a -> b) -> b -> Item a -> b # foldr1 :: (a -> a -> a) -> Item a -> a # foldl1 :: (a -> a -> a) -> Item a -> a # toList :: Item a -> [a] # null :: Item a -> Bool # length :: Item a -> Int # elem :: Eq a => a -> Item a -> Bool # maximum :: Ord a => Item a -> a # minimum :: Ord a => Item a -> a # sum :: Num a => Item a -> a # product :: Num a => Item a -> a #
Traversable Item # |
Methods traverse :: Applicative f => (a -> f b) -> Item a -> f (Item b) # sequenceA :: Applicative f => Item (f a) -> f (Item a) # mapM :: Monad m => (a -> m b) -> Item a -> m (Item b) # sequence :: Monad m => Item (m a) -> m (Item a) #
Show a => Show (Item a) # |
Methods showsPrec :: Int -> Item a -> ShowS # show :: Item a -> String # showList :: [Item a] -> ShowS #
Binary a => Binary (Item a) # |
Methods put :: Item a -> Put # get :: Get (Item a) # putList :: [Item a] -> Put #

itemSetBody :: a -> Item b -> Item a #

withItemBody :: (a -> Compiler b) -> Item a -> Compiler (Item b) #

Perform a compiler action on the item body. This is the same as `traverse`, but looks less intimidating.

    withItemBody = traverse