hakyll-4.16.2.2: A static website compiler library

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hakyll.Core.Rules.Internal

Synopsis

- data RulesRead = RulesRead {
  - rulesProvider :: Provider
  - rulesMatches :: [Identifier]
  - rulesVersion :: Maybe String
  }
- data RuleSet = RuleSet {
  - rulesRoutes :: Routes
  - rulesCompilers :: [(Identifier, Compiler SomeItem)]
  - rulesResources :: Set Identifier
  - rulesPattern :: Pattern
  }
- data RulesState = RulesState {
  - rulesRoute :: Maybe Routes
  - rulesCompiler :: Maybe (Compiler SomeItem)
  }
- emptyRulesState :: RulesState
- newtype Rules a = Rules {
  - unRules :: RWST RulesRead RuleSet RulesState IO a
  }
- runRules :: Rules a -> Provider -> IO RuleSet

# Documentation

data RulesRead Source #

Constructors

RulesRead |

Fields

- rulesProvider :: Provider
- rulesMatches :: [Identifier]
- rulesVersion :: Maybe String

data RuleSet Source #

Constructors

RuleSet |

Fields

- rulesRoutes :: Routes

  Accumulated routes

- rulesCompilers :: [(Identifier, Compiler SomeItem)]

  Accumulated compilers

- rulesResources :: Set Identifier

  A set of the actually used files

- rulesPattern :: Pattern

  A pattern we can use to check if a file *would* be used. This is needed for the preview server.

#### Instances

Instances details

Monoid RuleSet Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods mempty :: RuleSet Source # mappend :: RuleSet -> RuleSet -> RuleSet Source # mconcat :: [RuleSet] -> RuleSet Source #
Semigroup RuleSet Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods (<>) :: RuleSet -> RuleSet -> RuleSet Source # sconcat :: NonEmpty RuleSet -> RuleSet Source # stimes :: Integral b => b -> RuleSet -> RuleSet Source #

data RulesState Source #

Constructors

RulesState |

Fields

- rulesRoute :: Maybe Routes
- rulesCompiler :: Maybe (Compiler SomeItem)

emptyRulesState :: RulesState Source #

newtype Rules a Source #

The monad used to compose rules

Constructors

Rules |

Fields

- unRules :: RWST RulesRead RuleSet RulesState IO a

#### Instances

Instances details

MonadFail Rules Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods fail :: String -> Rules a Source #
Applicative Rules Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods pure :: a -> Rules a Source # (<*>) :: Rules (a -> b) -> Rules a -> Rules b Source # liftA2 :: (a -> b -> c) -> Rules a -> Rules b -> Rules c Source # (*>) :: Rules a -> Rules b -> Rules b Source # (<*) :: Rules a -> Rules b -> Rules a Source #
Functor Rules Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods fmap :: (a -> b) -> Rules a -> Rules b Source # (<$) :: a -> Rules b -> Rules a Source #
Monad Rules Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods (>>=) :: Rules a -> (a -> Rules b) -> Rules b Source # (>>) :: Rules a -> Rules b -> Rules b Source # return :: a -> Rules a Source #
MonadMetadata Rules Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods getMetadata :: Identifier -> Rules Metadata Source # getMatches :: Pattern -> Rules [Identifier] Source # getAllMetadata :: Pattern -> Rules [(Identifier, Metadata)] Source #

runRules :: Rules a -> Provider -> IO RuleSet Source #

Run a Rules monad, resulting in a `RuleSet`