summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Compiler
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-01-04 13:09:45 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-01-04 13:09:45 +0100
commit77c7d8dc17a86640180b9b233f6e0fd9008c6848 (patch)
treea9185023a15b6a1c65866b67d2bf1745721a1e53 /src/Hakyll/Core/Compiler
parent0969fe41c7c94c34e5663ed231ecbb9e2c4bc051 (diff)
downloadhakyll-77c7d8dc17a86640180b9b233f6e0fd9008c6848.tar.gz
Add in-memory map to store
This allows us to get rid of the dependency lookup map and use one uniform cache/lookup.
Diffstat (limited to 'src/Hakyll/Core/Compiler')
-rw-r--r--src/Hakyll/Core/Compiler/Internal.hs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs
index 1796565..0642b85 100644
--- a/src/Hakyll/Core/Compiler/Internal.hs
+++ b/src/Hakyll/Core/Compiler/Internal.hs
@@ -3,7 +3,6 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Hakyll.Core.Compiler.Internal
( Dependencies
- , DependencyLookup
, CompilerEnvironment (..)
, CompilerM (..)
, Compiler (..)
@@ -23,7 +22,6 @@ import Control.Category (Category, (.), id)
import Control.Arrow (Arrow, arr, first)
import Hakyll.Core.Identifier
-import Hakyll.Core.CompiledItem
import Hakyll.Core.ResourceProvider
import Hakyll.Core.Store
@@ -31,10 +29,6 @@ import Hakyll.Core.Store
--
type Dependencies = Set Identifier
--- | A lookup with which we can get dependencies
---
-type DependencyLookup = Identifier -> Maybe CompiledItem
-
-- | Environment in which a compiler runs
--
data CompilerEnvironment = CompilerEnvironment
@@ -42,8 +36,6 @@ data CompilerEnvironment = CompilerEnvironment
compilerIdentifier :: Identifier
, -- | Resource provider
compilerResourceProvider :: ResourceProvider
- , -- | Dependency lookup
- compilerDependencyLookup :: DependencyLookup
, -- | Site route
compilerRoute :: Maybe FilePath
, -- | Compiler store
@@ -81,18 +73,16 @@ instance Arrow Compiler where
runCompilerJob :: Compiler () a -- ^ Compiler to run
-> Identifier -- ^ Target identifier
-> ResourceProvider -- ^ Resource provider
- -> DependencyLookup -- ^ Dependency lookup table
-> Maybe FilePath -- ^ Route
-> Store -- ^ Store
-> Bool -- ^ Was the resource modified?
-> IO a
-runCompilerJob compiler identifier provider lookup' route store modified =
+runCompilerJob compiler identifier provider route store modified =
runReaderT (unCompilerM $ compilerJob compiler ()) env
where
env = CompilerEnvironment
{ compilerIdentifier = identifier
, compilerResourceProvider = provider
- , compilerDependencyLookup = lookup'
, compilerRoute = route
, compilerStore = store
, compilerResourceModified = modified