@@ -3,12 +3,12 @@ module Hakyll.Core.Compiler.Require
33 ( Snapshot
44 , save
55 , saveSnapshot
6− , require
7− , requireSnapshot
8− , requireBody
9− , requireSnapshotBody
10− , requireAll
11− , requireAllSnapshots
6+ , load
7+ , loadSnapshot
8+ , loadBody
9+ , loadSnapshotBody
10+ , loadAll
11+ , loadAllSnapshots
1212 ) where
1313
1414
@@ -44,7 +44,7 @@ save store item = saveSnapshot store final item
4444
4545--------------------------------------------------------------------------------
4646-- | Save a specific snapshot of an item, so you can load it later using
47−-- 'requireSnapshot'.
47+-- 'loadSnapshot'.
4848saveSnapshot :: (Binary a, Typeable a)
4949 => Store -> Snapshot -> Item a -> IO ()
5050saveSnapshot store snapshot item =
@@ -54,15 +54,15 @@ saveSnapshot store snapshot item =
5454--------------------------------------------------------------------------------
5555-- | Load an item compiled elsewhere. If the required item is not yet compiled,
5656-- the build system will take care of that automatically.
57−require :: (Binary a, Typeable a) => Identifier -> Compiler (Item a)
58−require id' = requireSnapshot id' final
57+load :: (Binary a, Typeable a) => Identifier -> Compiler (Item a)
58+load id' = loadSnapshot id' final
5959
6060
6161--------------------------------------------------------------------------------
6262-- | Require a specific snapshot of an item.
63−requireSnapshot :: (Binary a, Typeable a)
64− => Identifier -> Snapshot -> Compiler (Item a)
65−requireSnapshot id' snapshot = do
63+loadSnapshot :: (Binary a, Typeable a)
64+ => Identifier -> Snapshot -> Compiler (Item a)
65+loadSnapshot id' snapshot = do
6666 store <- compilerStore <$> compilerAsk
6767 universe <- compilerUniverse <$> compilerAsk
6868
@@ -78,12 +78,12 @@ requireSnapshot id' snapshot = do
7878 Store.Found x -> return $ Item id' x
7979 where
8080 notFound =
81− "Hakyll.Core.Compiler.Require.require: " ++ show id' ++
81+ "Hakyll.Core.Compiler.Require.load: " ++ show id' ++
8282 " (snapshot " ++ snapshot ++ ") was not found in the cache, " ++
8383 "the cache might be corrupted or " ++
8484 "the item you are referring to might not exist"
8585 wrongType e r =
86− "Hakyll.Core.Compiler.Require.require: " ++ show id' ++
86+ "Hakyll.Core.Compiler.Require.load: " ++ show id' ++
8787 " (snapshot " ++ snapshot ++ ") was found in the cache, " ++
8888 "but does not have the right type: expected " ++ show e ++
8989 " but got " ++ show r
@@ -92,29 +92,29 @@ requireSnapshot id' snapshot = do
9292--------------------------------------------------------------------------------
9393-- | A shortcut for only requiring the body of an item.
9494--
95−-- > requireBody = fmap itemBody . require
96−requireBody :: (Binary a, Typeable a) => Identifier -> Compiler a
97−requireBody id' = requireSnapshotBody id' final
95+-- > loadBody = fmap itemBody . load
96+loadBody :: (Binary a, Typeable a) => Identifier -> Compiler a
97+loadBody id' = loadSnapshotBody id' final
9898
9999
100100--------------------------------------------------------------------------------
101−requireSnapshotBody :: (Binary a, Typeable a)
102− => Identifier -> Snapshot -> Compiler a
103−requireSnapshotBody id' snapshot = fmap itemBody $ requireSnapshot id' snapshot
101+loadSnapshotBody :: (Binary a, Typeable a)
102+ => Identifier -> Snapshot -> Compiler a
103+loadSnapshotBody id' snapshot = fmap itemBody $ loadSnapshot id' snapshot
104104
105105
106106--------------------------------------------------------------------------------
107−-- | This function allows you to 'require' a dynamic list of items
108−requireAll :: (Binary a, Typeable a) => Pattern -> Compiler [Item a]
109−requireAll pattern = requireAllSnapshots pattern final
107+-- | This function allows you to 'load' a dynamic list of items
108+loadAll :: (Binary a, Typeable a) => Pattern -> Compiler [Item a]
109+loadAll pattern = loadAllSnapshots pattern final
110110
111111
112112--------------------------------------------------------------------------------
113−requireAllSnapshots :: (Binary a, Typeable a)
114− => Pattern -> Snapshot -> Compiler [Item a]
115−requireAllSnapshots pattern snapshot = do
113+loadAllSnapshots :: (Binary a, Typeable a)
114+ => Pattern -> Snapshot -> Compiler [Item a]
115+loadAllSnapshots pattern snapshot = do
116116 matching <- getMatches pattern
117− mapM (\i -> requireSnapshot i snapshot) matching
117+ mapM (\i -> loadSnapshot i snapshot) matching
118118
119119
120120--------------------------------------------------------------------------------