poke -package:streamly-core

Write the given value to the given memory location. Alignment restrictions might apply; see peek.
Serializes a value to bytes. It is the responsibility of the caller to ensure that at least the number of bytes required by size are available. These details are handled by encode and similar utilities.
Serializes a value to bytes. It is the responsibility of the caller to ensure that at least the number of bytes required by size are available. These details are handled by encode and similar utilities.
Write a Vector to a contiguous piece of memory.
Write to memory
Just like peek, except if both the "test" and the "fail" validators fail, their results are mappended (<>).

Example

>>> let failV = failIf ["I'm less than 3"] (<3)

>>> let passV = failIf ["I'm greater than 4"] (>4)

>>> let testV = failIf ["I'm not divisible by 2"] odd

>>> let exV = poke failV passV testV
>>> validateP exV 7
Left (Valid 7)
>>> validateP exV 6
Right ["I'm greater than 4"]
>>> validateP exV 2
Left (Valid 2)
>>> validateP exV 1
Right ["I'm not divisible by 2","I'm less than 3"]
Not on Stackage, so not searched. Discord verification bot
Changing a sequence of bytes starting from the given pointer. Pokes are the most primitive buffer manipulation. In most cases, you don't use the explicitly but as part of a Write, which also tells how many bytes will be changed at most.
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.
Specification of a sized and errorless writing action to a pointer.
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.
Abstraction over an IO action, which takes a pointer, populates it and produces a pointer right after the populated data.
Poke newtype wrapper.