hakyll-4.9.8.0: A static website compiler library

Safe Haskell | None
Language | Haskell98

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 #

Constructors

RulesRead |
Fields rulesProvider :: Provider rulesMatches :: [Identifier] rulesVersion :: Maybe String

data RuleSet #

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

Monoid RuleSet # |
Methods mempty :: RuleSet # mappend :: RuleSet -> RuleSet -> RuleSet # mconcat :: [RuleSet] -> RuleSet #

data RulesState #

Constructors

RulesState |
Fields rulesRoute :: Maybe Routes rulesCompiler :: Maybe (Compiler SomeItem)

emptyRulesState :: RulesState #

newtype Rules a #

The monad used to compose rules

Constructors

Rules |
Fields unRules :: RWST RulesRead RuleSet RulesState IO a

Instances

Monad Rules # |
Methods (>>=) :: Rules a -> (a -> Rules b) -> Rules b # (>>) :: Rules a -> Rules b -> Rules b # return :: a -> Rules a # fail :: String -> Rules a #
Functor Rules # |
Methods fmap :: (a -> b) -> Rules a -> Rules b # (<$) :: a -> Rules b -> Rules a #
Applicative Rules # |
Methods pure :: a -> Rules a # (<*>) :: Rules (a -> b) -> Rules a -> Rules b # (*>) :: Rules a -> Rules b -> Rules b # (<*) :: Rules a -> Rules b -> Rules a #
MonadMetadata Rules # |
Methods getMetadata :: Identifier -> Rules Metadata # getMatches :: Pattern -> Rules [Identifier] # getAllMetadata :: Pattern -> Rules [(Identifier, Metadata)] #

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

Run a Rules monad, resulting in a `RuleSet`