Poke actions are useful for building sequential serializers.
They are actions which write values to bytes into memory specified by a Ptr base. The Applicative and Monad instances make it easy to write serializations, by keeping track of the Offset of the current byte. They allow you to chain Poke action such that subsequent Pokes write into subsequent portions of the output.
Constructors
PokerunPoke :: PokeState -> Offset -> IO (Offset, a)Run the Poke action, with the Ptr to the buffer where data is poked, and the current Offset. The result is the new offset, along with a return value.
May throw a PokeException, though this should be avoided when possible. They usually indicate a programming error.