@@ -142,9 +142,9 @@ import Hakyll.Core.Logger
142142-- version of 'runCompilerJob' also stores the result
143143--
144144runCompiler :: Compiler () CompileRule -- ^ Compiler to run
145− -> Identifier -- ^ Target identifier
145+ -> Identifier () -- ^ Target identifier
146146 -> ResourceProvider -- ^ Resource provider
147− -> [Identifier] -- ^ Universe
147+ -> [Identifier ()] -- ^ Universe
148148 -> Routes -- ^ Route
149149 -> Store -- ^ Store
150150 -> Bool -- ^ Was the resource modified?
@@ -161,7 +161,8 @@ runCompiler compiler id' provider universe routes store modified logger = do
161161 -- before we return control. This makes sure the compiled item can later
162162 -- be accessed by e.g. require.
163163 Right (CompileRule (CompiledItem x)) ->
164− storeSet store "Hakyll.Core.Compiler.runCompiler" id' x
164+ storeSet store "Hakyll.Core.Compiler.runCompiler"
165+ (castIdentifier id') x
165166
166167 -- Otherwise, we do nothing here
167168 _ -> return ()
@@ -170,8 +171,9 @@ runCompiler compiler id' provider universe routes store modified logger = do
170171
171172-- | Get the identifier of the item that is currently being compiled
172173--
173−getIdentifier :: Compiler a Identifier
174−getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
174+getIdentifier :: Compiler a (Identifier b)
175+getIdentifier = fromJob $ const $ CompilerM $
176+ castIdentifier . compilerIdentifier <$> ask
175177
176178-- | Get the route we are using for this item
177179--
@@ -180,7 +182,7 @@ getRoute = getIdentifier >>> getRouteFor
180182
181183-- | Get the route for a specified item
182184--
183−getRouteFor :: Compiler Identifier (Maybe FilePath)
185+getRouteFor :: Compiler (Identifier a) (Maybe FilePath)
184186getRouteFor = fromJob $ \identifier -> CompilerM $ do
185187 routes <- compilerRoutes <$> ask
186188 return $ runRoutes routes identifier
@@ -212,7 +214,7 @@ getResourceWith reader = fromJob $ \resource -> CompilerM $ do
212214-- | Auxiliary: get a dependency
213215--
214216getDependency :: (Binary a, Writable a, Typeable a)
215− => Identifier -> CompilerM a
217+ => Identifier a -> CompilerM a
216218getDependency id' = CompilerM $ do
217219 store <- compilerStore <$> ask
218220 result <- liftIO $ storeGet store "Hakyll.Core.Compiler.runCompiler" id'
@@ -233,7 +235,7 @@ getDependency id' = CompilerM $ do
233235-- | Variant of 'require' which drops the current value
234236--
235237require_ :: (Binary a, Typeable a, Writable a)
236− => Identifier
238+ => Identifier a
237239 -> Compiler b a
238240require_ identifier =
239241 fromDependency identifier >>> fromJob (const $ getDependency identifier)
@@ -242,7 +244,7 @@ require_ identifier =
242244-- dependencies
243245--
244246require :: (Binary a, Typeable a, Writable a)
245− => Identifier
247+ => Identifier a
246248 -> (b -> a -> c)
247249 -> Compiler b c
248250require identifier = requireA identifier . arr . uncurry
@@ -250,7 +252,7 @@ require identifier = requireA identifier . arr . uncurry
250252-- | Arrow-based variant of 'require'
251253--
252254requireA :: (Binary a, Typeable a, Writable a)
253− => Identifier
255+ => Identifier a
254256 -> Compiler (b, a) c
255257 -> Compiler b c
256258requireA identifier = (id &&& require_ identifier >>>)
@@ -262,7 +264,7 @@ requireAll_ :: (Binary a, Typeable a, Writable a)
262264 -> Compiler b [a]
263265requireAll_ pattern = fromDependencies (const getDeps) >>> fromJob requireAll_'
264266 where
265− getDeps = filterMatches pattern
267+ getDeps = map castIdentifier . filterMatches pattern . map castIdentifier
266268 requireAll_' = const $ CompilerM $ do
267269 deps <- getDeps . compilerUniverse <$> ask
268270 mapM (unCompilerM . getDependency) deps
@@ -290,7 +292,7 @@ cached :: (Binary a, Typeable a, Writable a)
290292 -> Compiler Resource a
291293cached name (Compiler d j) = Compiler d $ const $ CompilerM $ do
292294 logger <- compilerLogger <$> ask
293− identifier <- compilerIdentifier <$> ask
295+ identifier <- castIdentifier . compilerIdentifier <$> ask
294296 store <- compilerStore <$> ask
295297 modified <- compilerResourceModified <$> ask
296298 report logger $ "Checking cache: " ++ if modified then "modified" else "OK"