Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ContentStore
- class Monad m => ContentHashable (m :: Type -> Type) a
- type PureHashable = ContentHashable Identity
- type IOHashable = ContentHashable IO
- class ProvidesCaching eff where
- usingStore :: (ContentHashable IO a, Store b) => eff a b -> eff a b
- class ProvidesCaching eff => ProvidesPosCaching eff where
- usingStore' :: (ContentHashable IO a, Store b) => eff a b -> eff a b
- newtype AutoIdent (arr :: Type -> Type -> Type) a b = AutoIdent (ArrowIdent -> arr a b)
- data SomeHashable where
- SomePureHashable :: PureHashable a => a -> SomeHashable
- SomeIOHashable :: IOHashable a => a -> SomeHashable
- data StoreWithId remoteCacher = StoreWithId ContentStore remoteCacher (Maybe Int)
- type LocalStoreWithId = StoreWithId NoCache
- type CachingContext = [SomeHashable]
- withStore :: (MonadIO m, MonadMask m) => Path Abs Dir -> (ContentStore -> m a) -> m a
- caching :: (Arrow core, ProvidesCaching core, ContentHashable IO ident, ContentHashable IO a, Store b) => ident -> Rope r mantle core a b -> Rope r mantle core a b
- caching' :: (ProvidesPosCaching core, ContentHashable IO a, Show a, Store b) => Rope r mantle core a b -> Rope r mantle core a b
- localStoreWithId :: ContentStore -> Maybe Int -> LocalStoreWithId
Documentation
data ContentStore #
A hash addressed store on the file system.
class Monad m => ContentHashable (m :: Type -> Type) a #
Instances
type PureHashable = ContentHashable Identity Source #
A value directly hashable
type IOHashable = ContentHashable IO Source #
A value hashable via some IO action
class ProvidesCaching eff where Source #
A class to cache part of the pipeline
usingStore :: (ContentHashable IO a, Store b) => eff a b -> eff a b Source #
Instances
class ProvidesCaching eff => ProvidesPosCaching eff where Source #
A class to cache part of the pipeline where the hash can depend on the position of the task in the pipeline
usingStore' :: (ContentHashable IO a, Store b) => eff a b -> eff a b Source #
Instances
(Arrow eff, ProvidesCaching eff) => ProvidesPosCaching (AutoIdent eff) Source # | |
Defined in Control.Kernmantle.Caching usingStore' :: (ContentHashable IO a, Store b) => AutoIdent eff a b -> AutoIdent eff a b Source # | |
(Functor f, ProvidesPosCaching eff) => ProvidesPosCaching (f ~> eff) Source # | |
Defined in Control.Kernmantle.Caching usingStore' :: (ContentHashable IO a, Store b) => (f ~> eff) a b -> (f ~> eff) a b Source # | |
(Arrow eff, ProvidesPosCaching eff) => ProvidesPosCaching (Writer CachingContext ~> eff) Source # | |
Defined in Control.Kernmantle.Caching usingStore' :: (ContentHashable IO a, Store b) => (Writer CachingContext ~> eff) a b -> (Writer CachingContext ~> eff) a b Source # | |
ProvidesPosCaching core => ProvidesPosCaching (Rope r m core) Source # | |
Defined in Control.Kernmantle.Caching usingStore' :: (ContentHashable IO a, Store b) => Rope r m core a b -> Rope r m core a b Source # |
newtype AutoIdent (arr :: Type -> Type -> Type) a b #
An arrow transformer that can automatically determine an identifier from
its position in a pipeline. It is isomorphic to a Reader ArrowIdent ~> arr
, but
we need a different Arrow instance than what Cayley
provides.
AutoIdent (ArrowIdent -> arr a b) |
Instances
data SomeHashable where Source #
SomePureHashable :: PureHashable a => a -> SomeHashable | |
SomeIOHashable :: IOHashable a => a -> SomeHashable |
Instances
ContentHashable IO SomeHashable Source # | |
Defined in Control.Kernmantle.Caching contentHashUpdate :: Context SHA256 -> SomeHashable -> IO (Context SHA256) # contentHash :: SomeHashable -> IO ContentHash # | |
(Arrow eff, ProvidesPosCaching eff) => ProvidesPosCaching (Writer CachingContext ~> eff) Source # | |
Defined in Control.Kernmantle.Caching usingStore' :: (ContentHashable IO a, Store b) => (Writer CachingContext ~> eff) a b -> (Writer CachingContext ~> eff) a b Source # | |
(Arrow eff, ProvidesCaching eff) => ProvidesCaching (Writer CachingContext ~> eff) Source # | |
Defined in Control.Kernmantle.Caching usingStore :: (ContentHashable IO a, Store b) => (Writer CachingContext ~> eff) a b -> (Writer CachingContext ~> eff) a b Source # |
data StoreWithId remoteCacher Source #
Bundles together a store with an identifier for the whole pipeline. If identifier is Nothing, no caching will be performed.
StoreWithId ContentStore remoteCacher (Maybe Int) |
Instances
(MonadIO m, MonadUnliftIO m, MonadMask m, Cacher m remoteCacher, HasKleisli m eff) => ProvidesCaching (Reader (StoreWithId remoteCacher) ~> eff) Source # | |
Defined in Control.Kernmantle.Caching usingStore :: (ContentHashable IO a, Store b) => (Reader (StoreWithId remoteCacher) ~> eff) a b -> (Reader (StoreWithId remoteCacher) ~> eff) a b Source # |
type LocalStoreWithId = StoreWithId NoCache Source #
type CachingContext = [SomeHashable] Source #
withStore :: (MonadIO m, MonadMask m) => Path Abs Dir -> (ContentStore -> m a) -> m a #
Open the store under the given root and perform the given action. Closes the store once the action is complete
See also: open
caching :: (Arrow core, ProvidesCaching core, ContentHashable IO ident, ContentHashable IO a, Store b) => ident -> Rope r mantle core a b -> Rope r mantle core a b Source #
Any rope whose core provides caching can run cached tasks. The task is identified by an explicit identifier
caching' :: (ProvidesPosCaching core, ContentHashable IO a, Show a, Store b) => Rope r mantle core a b -> Rope r mantle core a b Source #
Any rope whose core provides caching can run cached tasks. The task is identified by its position in the pipeline
localStoreWithId :: ContentStore -> Maybe Int -> LocalStoreWithId Source #
A StoreWithId
with no remote caching
Orphan instances
Monad m => ContentHashable m ArrowIdent Source # | |
contentHashUpdate :: Context SHA256 -> ArrowIdent -> m (Context SHA256) # contentHash :: ArrowIdent -> m ContentHash # | |
Monad m => ContentHashable m SplitId Source # | |
contentHashUpdate :: Context SHA256 -> SplitId -> m (Context SHA256) # contentHash :: SplitId -> m ContentHash # |