roshask-0.2: Haskell support for the ROS robotics framework.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Ros.Topic.Transformers

Description

Functions for working with Topics built around monad transformers. These make it possible to, for example, repeat a stateful action to produce a Topic's values.

Synopsis

Documentation

runTopicState :: Monad m => Topic (StateT s m) a -> s -> Topic m a Source

Run a Topic built around a lazy StateT s monad using a given initial state.

runTopicState' :: Monad m => Topic (StateT s m) a -> s -> Topic m a Source

Run a Topic build around a strict StateT s monad using a given initial state.

runTopicReader :: (Functor m, Monad m) => Topic (ReaderT r m) a -> r -> Topic m a Source

Run a Topic built around a 'ReaderT r' monad using a value for reading.

liftMap :: (MonadTrans t, Monad m, Monad (t m)) => (a -> t m b) -> Topic m a -> Topic (t m) b Source

Map a monadic function over a Topic, in the process lifting the Topic into a new monad.