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

Safe HaskellSafe
LanguageHaskell2010

Ros.Internal.Util.StorableMonad

Description

An applicative interface for working with Storable values. The idea is that the underlying pointer is threaded through the computation to make reading and writing consecutive values easier.

Synopsis

Documentation

peek :: Storable a => StorableM a Source

Action that peeks a value from the current pointer location, then moves the pointer to just after the peeked value.

poke :: Storable a => a -> StorableM () Source

Action that pokes a value into the current pointer location, then moves the pointer to just after the poked value.

runStorable :: StorableM a -> Ptr b -> IO a Source

Run a StorableM action with the supplied initial pointer location.

type StorableM a = StateT (Ptr ()) IO a Source

A state monad that threads a pointer through a computation.