def Cursor.write.if
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
909def Cursor.write.if(~T: Data, ~write: Bytes -> @+i:U32 -> @+v:T -> Bytes, ok: Bool, c: Cursor, +n: U32, v: T) -> Cursor & Bool:
910 match ok:
911 case False{}:
912 (c, False{})
913 case True{}:
914 Cursor{b, +pos, start, end} = c
915 (Cursor{write(b, pos, v), (pos + n : U32), start, end}, True{})