diff options
| author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-13 13:13:17 +0100 |
|---|---|---|
| committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-13 13:13:17 +0100 |
| commit | 89272dd97f805695b3d03f9a9fb05d22f30d8a7d (patch) | |
| tree | 3ead5048b380454f42c84962513e53078506054c /src/Hakyll/Core/Rules | |
| parent | 760b4344377c81922ce5ab4ba05a41f88f45165d (diff) | |
| download | hakyll-89272dd97f805695b3d03f9a9fb05d22f30d8a7d.tar.gz | |
Simplify stuff
Diffstat (limited to 'src/Hakyll/Core/Rules')
| -rw-r--r-- | src/Hakyll/Core/Rules/Internal.hs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/Hakyll/Core/Rules/Internal.hs b/src/Hakyll/Core/Rules/Internal.hs index ec3714c..360293f 100644 --- a/src/Hakyll/Core/Rules/Internal.hs +++ b/src/Hakyll/Core/Rules/Internal.hs @@ -6,8 +6,7 @@ module Hakyll.Core.Rules.Internal ( RuleSet (..) , RuleState (..) , RuleEnvironment (..) - , RulesM (..) - , Rules + , Rules (..) , runRules ) where @@ -35,9 +34,9 @@ data RuleSet = RuleSet { -- | Routes used in the compilation structure rulesRoutes :: Routes , -- | Compilation rules - rulesCompilers :: [(Identifier (), Compiler CompiledItem)] + rulesCompilers :: [(Identifier, Compiler CompiledItem)] , -- | A set of the actually used files - rulesResources :: Set (Identifier ()) + rulesResources :: Set Identifier } @@ -59,29 +58,23 @@ data RuleState = RuleState -- | Rule environment data RuleEnvironment = RuleEnvironment { rulesResourceProvider :: ResourceProvider - , rulesPattern :: forall a. Pattern a + , rulesPattern :: Pattern , rulesVersion :: Maybe String } -------------------------------------------------------------------------------- -- | The monad used to compose rules -newtype RulesM a = RulesM - { unRulesM :: RWST RuleEnvironment RuleSet RuleState IO a +newtype Rules a = Rules + { unRules :: RWST RuleEnvironment RuleSet RuleState IO a } deriving (Monad, Functor, Applicative) -------------------------------------------------------------------------------- --- | Simplification of the RulesM type; usually, it will not return any --- result. -type Rules = RulesM () - - --------------------------------------------------------------------------------- -- | Run a Rules monad, resulting in a 'RuleSet' -runRules :: RulesM a -> ResourceProvider -> IO RuleSet +runRules :: Rules a -> ResourceProvider -> IO RuleSet runRules rules provider = do - (_, _, ruleSet) <- runRWST (unRulesM rules) env state + (_, _, ruleSet) <- runRWST (unRules rules) env state return $ nubCompilers ruleSet where state = RuleState {rulesNextIdentifier = 0} |
