Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Versioned a = Versioned {}
- type Var a = TVar (Versioned a)
- newVar :: MonadUnliftIO m => a -> m (Var a)
- readVar :: MonadUnliftIO m => Var a -> m a
- stateVar :: HasInput var => var -> StateVar (GetInput var)
- stateVarMap :: HasInput var => (GetInput var -> a) -> (a -> GetInput var -> GetInput var) -> var -> StateVar a
- class HasInput a where
- pushInput :: (MonadIO m, HasInput var) => var -> (GetInput var -> GetInput var) -> m ()
- pushInputSTM :: HasInput var => var -> (GetInput var -> GetInput var) -> STM ()
- updateInput :: (MonadIO m, HasInput var) => var -> (GetInput var -> Maybe (GetInput var)) -> m ()
- updateInputSTM :: HasInput var => var -> (GetInput var -> Maybe (GetInput var)) -> STM ()
- getInputData :: (HasInput worker, MonadIO m) => worker -> m (GetInput worker)
- getInputDataSTM :: HasInput worker => worker -> STM (GetInput worker)
- class HasConfig a where
- modifyConfig :: (MonadIO m, HasConfig var) => var -> (GetConfig var -> GetConfig var) -> m ()
- modifyConfigSTM :: HasConfig var => var -> (GetConfig var -> GetConfig var) -> STM ()
- class HasOutput a where
- pushOutput :: (MonadIO m, HasOutput var) => var -> (GetOutput var -> GetOutput var) -> m ()
- pushOutputSTM :: HasOutput var => var -> (GetOutput var -> GetOutput var) -> STM ()
- updateOutput :: (MonadIO m, HasOutput var) => var -> (GetOutput var -> Maybe (GetOutput var)) -> m ()
- updateOutputSTM :: HasOutput var => var -> (GetOutput var -> Maybe (GetOutput var)) -> STM ()
- getOutputData :: (HasOutput worker, MonadIO m) => worker -> m (GetOutput worker)
- getOutputDataSTM :: HasOutput worker => worker -> STM (GetOutput worker)
- data Cell input output = Cell {}
- spawnCell :: MonadUnliftIO m => (input -> output) -> input -> m (Cell input output)
- data Timed config output = Timed {}
- spawnTimed :: MonadUnliftIO m => Bool -> Either Int (config -> Int) -> (config -> m (output, state)) -> (state -> config -> m (Maybe output, state)) -> config -> m (Timed config output)
- spawnTimed_ :: MonadUnliftIO m => Bool -> Int -> output -> m output -> m (Timed () output)
- data Merge o = Merge {}
- spawnMerge1 :: (MonadUnliftIO m, HasOutput i) => (GetOutput i -> o) -> i -> m (Merge o)
- spawnMerge2 :: (MonadUnliftIO m, HasOutput i1, HasOutput i2) => (GetOutput i1 -> GetOutput i2 -> o) -> i1 -> i2 -> m (Merge o)
- spawnMerge3 :: (MonadUnliftIO m, HasOutput i1, HasOutput i2, HasOutput i3) => (GetOutput i1 -> GetOutput i2 -> GetOutput i3 -> o) -> i1 -> i2 -> i3 -> m (Merge o)
- spawnMerge4 :: (MonadUnliftIO m, HasOutput i1, HasOutput i2, HasOutput i3, HasOutput i4) => (GetOutput i1 -> GetOutput i2 -> GetOutput i3 -> GetOutput i4 -> o) -> i1 -> i2 -> i3 -> i4 -> m (Merge o)
- spawnMergeT :: (Traversable t, HasOutput input, MonadUnliftIO m) => (t (GetOutput input) -> output) -> t input -> m (Merge output)
- type ObserverIO a = IORef (Versioned a)
- newObserverIO :: MonadIO m => a -> m (ObserverIO a)
- observeIO :: (MonadUnliftIO m, HasOutput output) => output -> ObserverIO a -> (a -> GetOutput output -> m a) -> m a
- observeIO_ :: (MonadUnliftIO m, HasOutput output) => output -> ObserverIO a -> (a -> GetOutput output -> m a) -> m ()
- readObservedIO :: MonadUnliftIO m => IORef (Versioned a) -> m a
- data Source a
- newSource :: (MonadUnliftIO m, UnagiPrim a) => m (Source a)
- pubSource :: (MonadUnliftIO m, UnagiPrim a) => Source a -> a -> m ()
- subSource :: MonadUnliftIO m => Source a -> m (OutChan a)
- class HasWorker a where
- register :: (MonadResource m, HasWorker process) => process -> m ReleaseKey
- registerCollection :: (MonadResource m, HasWorker process, Foldable t) => t process -> m ReleaseKey
- registered :: (MonadResource m, HasWorker a) => m a -> m (ReleaseKey, a)
- registeredCollection :: (MonadResource m, HasWorker process, Traversable t) => (input -> m process) -> t input -> m (ReleaseKey, t process)
Documentation
Instances
stateVarMap :: HasInput var => (GetInput var -> a) -> (a -> GetInput var -> GetInput var) -> var -> StateVar a Source #
updateInput :: (MonadIO m, HasInput var) => var -> (GetInput var -> Maybe (GetInput var)) -> m () Source #
modifyConfig :: (MonadIO m, HasConfig var) => var -> (GetConfig var -> GetConfig var) -> m () Source #
pushOutput :: (MonadIO m, HasOutput var) => var -> (GetOutput var -> GetOutput var) -> m () Source #
updateOutput :: (MonadIO m, HasOutput var) => var -> (GetOutput var -> Maybe (GetOutput var)) -> m () Source #
updateOutputSTM :: HasOutput var => var -> (GetOutput var -> Maybe (GetOutput var)) -> STM () Source #
data Cell input output Source #
Updatable cell for composite input or costly output.
data Timed config output Source #
Timer-driven stateful producer.
spawnTimed :: MonadUnliftIO m => Bool -> Either Int (config -> Int) -> (config -> m (output, state)) -> (state -> config -> m (Maybe output, state)) -> config -> m (Timed config output) Source #
Supply-driven step cell.
spawnMerge2 :: (MonadUnliftIO m, HasOutput i1, HasOutput i2) => (GetOutput i1 -> GetOutput i2 -> o) -> i1 -> i2 -> m (Merge o) Source #
spawnMerge3 :: (MonadUnliftIO m, HasOutput i1, HasOutput i2, HasOutput i3) => (GetOutput i1 -> GetOutput i2 -> GetOutput i3 -> o) -> i1 -> i2 -> i3 -> m (Merge o) Source #
spawnMerge4 :: (MonadUnliftIO m, HasOutput i1, HasOutput i2, HasOutput i3, HasOutput i4) => (GetOutput i1 -> GetOutput i2 -> GetOutput i3 -> GetOutput i4 -> o) -> i1 -> i2 -> i3 -> i4 -> m (Merge o) Source #
spawnMergeT :: (Traversable t, HasOutput input, MonadUnliftIO m) => (t (GetOutput input) -> output) -> t input -> m (Merge output) Source #
Spawn a merge over a homogeneous traversable collection of processes.
A merging function will receive a collection of outputs to summarize.
type ObserverIO a = IORef (Versioned a) Source #
newObserverIO :: MonadIO m => a -> m (ObserverIO a) Source #
observeIO :: (MonadUnliftIO m, HasOutput output) => output -> ObserverIO a -> (a -> GetOutput output -> m a) -> m a Source #
observeIO_ :: (MonadUnliftIO m, HasOutput output) => output -> ObserverIO a -> (a -> GetOutput output -> m a) -> m () Source #
readObservedIO :: MonadUnliftIO m => IORef (Versioned a) -> m a Source #
registerCollection :: (MonadResource m, HasWorker process, Foldable t) => t process -> m ReleaseKey Source #
registered :: (MonadResource m, HasWorker a) => m a -> m (ReleaseKey, a) Source #
registeredCollection :: (MonadResource m, HasWorker process, Traversable t) => (input -> m process) -> t input -> m (ReleaseKey, t process) Source #