def Cursor.read.if
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
876def Cursor.read.if(~T: Data, ~read: Bytes -> @+i:U32 -> Bytes & Maybe<&2, T>, ok: Bool, c: Cursor, +n: U32) -> Cursor & Maybe<&2, T>:
877 match ok:
878 case False{}:
879 (c, None{})
880 case True{}:
881 Cursor{b, +pos, start, end} = c
882 Cursor.read.done(~T, pos, start, end, n, read(b, pos))