FlatZip[A: Any val, B: Any val]¶
Dependent sequencing: the second codec is determined by the first decoded value.
On decode, A is decoded first, then f(A) produces the codec for B.
On encode, A is available from the tuple, so f(A) can produce the
encoder for B.
Implements¶
- Codec[(A , B)] val
Constructors¶
create¶
Parameters¶
- ca: Codec[A] val
- f: {(A): Codec[B]}[A, B] val
Returns¶
- FlatZip[A, B] val^
Public Functions¶
decode¶
Parameters¶
Returns¶
- (((A , B) , USize val) | DecodeError)
encode¶
Parameters¶
- value: (A , B)
Returns¶
- (Array[U8 val] val | EncodeError)