diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-18 21:56:52 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-18 21:56:52 +0100 |
commit | 877cb21d1630d32c6e40eb7c6f0ecc7e1da2bd52 (patch) | |
tree | 57ce11325adbbb7502086450dd1d1a9f1e81b8f2 /src/Hakyll/Core/Rules | |
parent | 1347b0fa6cdd98986f927368e76e849068f69e1a (diff) | |
download | hakyll-877cb21d1630d32c6e40eb7c6f0ecc7e1da2bd52.tar.gz |
Add Item abstraction
Diffstat (limited to 'src/Hakyll/Core/Rules')
-rw-r--r-- | src/Hakyll/Core/Rules/Internal.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Hakyll/Core/Rules/Internal.hs b/src/Hakyll/Core/Rules/Internal.hs index 360293f..a067b02 100644 --- a/src/Hakyll/Core/Rules/Internal.hs +++ b/src/Hakyll/Core/Rules/Internal.hs @@ -20,11 +20,11 @@ import Data.Set (Set) -------------------------------------------------------------------------------- -import Hakyll.Core.CompiledItem import Hakyll.Core.Compiler.Internal import Hakyll.Core.Identifier import Hakyll.Core.Identifier.Pattern -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Item.SomeItem +import Hakyll.Core.Provider import Hakyll.Core.Routes @@ -34,7 +34,7 @@ data RuleSet = RuleSet { -- | Routes used in the compilation structure rulesRoutes :: Routes , -- | Compilation rules - rulesCompilers :: [(Identifier, Compiler CompiledItem)] + rulesCompilers :: [(Identifier, Compiler SomeItem)] , -- | A set of the actually used files rulesResources :: Set Identifier } @@ -57,9 +57,9 @@ data RuleState = RuleState -------------------------------------------------------------------------------- -- | Rule environment data RuleEnvironment = RuleEnvironment - { rulesResourceProvider :: ResourceProvider - , rulesPattern :: Pattern - , rulesVersion :: Maybe String + { rulesProvider :: Provider + , rulesPattern :: Pattern + , rulesVersion :: Maybe String } @@ -72,16 +72,16 @@ newtype Rules a = Rules -------------------------------------------------------------------------------- -- | Run a Rules monad, resulting in a 'RuleSet' -runRules :: Rules a -> ResourceProvider -> IO RuleSet +runRules :: Rules a -> Provider -> IO RuleSet runRules rules provider = do (_, _, ruleSet) <- runRWST (unRules rules) env state return $ nubCompilers ruleSet where state = RuleState {rulesNextIdentifier = 0} env = RuleEnvironment - { rulesResourceProvider = provider - , rulesPattern = mempty - , rulesVersion = Nothing + { rulesProvider = provider + , rulesPattern = mempty + , rulesVersion = Nothing } |