Safe Haskell | None |
---|---|
Language | Haskell2010 |
LiveCoding.Cell.Resample
Description
Run a cell at a fixed integer multiple speed. The general approach is to take an existing cell (the "inner" cell) and produce a new cell (the "outer" cell) that will accept several copies of the input. The inner cell is stepped for each input.
Synopsis
- resample :: forall (m :: Type -> Type) (n :: Nat) a b. (Monad m, KnownNat n) => Cell m a b -> Cell m (Vector n a) (Vector n b)
- resampleList :: forall (m :: Type -> Type) a b. Monad m => Cell m a b -> Cell m [a] [b]
- resampleMaybe :: forall (m :: Type -> Type) a b. Monad m => Cell m a b -> Cell m (Maybe a) (Maybe b)
- resampleListPar :: forall (m :: Type -> Type) a b. Monad m => Cell m a b -> Cell m [a] [b]
Documentation
resample :: forall (m :: Type -> Type) (n :: Nat) a b. (Monad m, KnownNat n) => Cell m a b -> Cell m (Vector n a) (Vector n b) Source #
Execute the inner cell for n steps per outer step.
resampleList :: forall (m :: Type -> Type) a b. Monad m => Cell m a b -> Cell m [a] [b] Source #
Execute the cell for as many steps as the input list is long.
resampleMaybe :: forall (m :: Type -> Type) a b. Monad m => Cell m a b -> Cell m (Maybe a) (Maybe b) Source #
resampleListPar :: forall (m :: Type -> Type) a b. Monad m => Cell m a b -> Cell m [a] [b] Source #
Create as many cells as the input list is long and execute them in parallel (in the sense that each one has a separate state). At each tick the list with the different states grows or shrinks depending on the size of the input list.
Similar to Yampa's parC.