State for the decoder: a ByteArray and a current position.
Constructor
Jar.Codec.DecodeState.mk
Fields
data : ByteArray
pos : Nat
Decoding is the inverse of encoding: binary bytes back to structured types.
The decoder uses a monadic combinator approach — a Decoder α consumes bytes
from a DecodeState and returns Option (α × DecodeState).
Jar.Codec.DecodeState : TypeJar.Codec.DecodeState : Type
State for the decoder: a ByteArray and a current position.
Jar.Codec.DecodeState.mk
data : ByteArray
pos : Nat
Jar.Codec.Decoder (α : Type) : TypeJar.Codec.Decoder (α : Type) : Type
Decoder monad: a function from state to an optional (result, new state).
Run a decoder on a ByteArray starting at position 0.
Bind: sequence two decoders.
Read exactly n bytes from the input.
Pure: return a value without consuming any input.
Guard: fail if condition is false.
Read a single byte.
Check remaining bytes available.