Safe Haskell | None |
---|
- data Compiler a
- getUnderlying :: Compiler Identifier
- getUnderlyingExtension :: Compiler String
- makeItem :: a -> Compiler (Item a)
- getRoute :: Identifier -> Compiler (Maybe FilePath)
- getResourceBody :: Compiler (Item String)
- getResourceString :: Compiler (Item String)
- getResourceLBS :: Compiler (Item ByteString)
- getResourceFilePath :: Compiler FilePath
- type Snapshot = String
- saveSnapshot :: (Binary a, Typeable a) => Snapshot -> Item a -> Compiler (Item a)
- load :: (Binary a, Typeable a) => Identifier -> Compiler (Item a)
- loadSnapshot :: (Binary a, Typeable a) => Identifier -> Snapshot -> Compiler (Item a)
- loadBody :: (Binary a, Typeable a) => Identifier -> Compiler a
- loadSnapshotBody :: (Binary a, Typeable a) => Identifier -> Snapshot -> Compiler a
- loadAll :: (Binary a, Typeable a) => Pattern -> Compiler [Item a]
- loadAllSnapshots :: (Binary a, Typeable a) => Pattern -> Snapshot -> Compiler [Item a]
- cached :: (Binary a, Typeable a) => String -> Compiler a -> Compiler a
- unsafeCompiler :: IO a -> Compiler a
- debugCompiler :: String -> Compiler ()
Documentation
A monad which lets you compile items and takes care of dependency tracking for you.
Monad Compiler | |
Functor Compiler | |
Applicative Compiler | |
Alternative Compiler | |
MonadMetadata Compiler | |
MonadError [String] Compiler |
getUnderlying :: Compiler IdentifierSource
Get the underlying identifier.
getUnderlyingExtension :: Compiler StringSource
Get the extension of the underlying identifier. Returns something like
.html
getRoute :: Identifier -> Compiler (Maybe FilePath)Source
Get the route for a specified item
getResourceBody :: Compiler (Item String)Source
Get the body of the underlying resource
getResourceString :: Compiler (Item String)Source
Get the resource we are compiling as a string
getResourceLBS :: Compiler (Item ByteString)Source
Get the resource we are compiling as a lazy bytestring
getResourceFilePath :: Compiler FilePathSource
Get the file path of the resource we are compiling
Whilst compiling an item, it possible to save multiple snapshots of it, and not just the final result.
saveSnapshot :: (Binary a, Typeable a) => Snapshot -> Item a -> Compiler (Item a)Source
Save a snapshot of the item. This function returns the same item, which
convenient for building >>=
chains.
load :: (Binary a, Typeable a) => Identifier -> Compiler (Item a)Source
Load an item compiled elsewhere. If the required item is not yet compiled, the build system will take care of that automatically.
loadSnapshot :: (Binary a, Typeable a) => Identifier -> Snapshot -> Compiler (Item a)Source
Require a specific snapshot of an item.
loadBody :: (Binary a, Typeable a) => Identifier -> Compiler aSource
A shortcut for only requiring the body of an item.
loadBody = fmap itemBody . load
loadSnapshotBody :: (Binary a, Typeable a) => Identifier -> Snapshot -> Compiler aSource
loadAll :: (Binary a, Typeable a) => Pattern -> Compiler [Item a]Source
This function allows you to load
a dynamic list of items
unsafeCompiler :: IO a -> Compiler aSource
debugCompiler :: String -> Compiler ()Source
Compiler for debugging purposes