def Parse.byte.checked
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
import bend-trace-context@0.2.0.0/src/digits.bend as Digits
820# The two digits of a cell, or InvalidByte at its offset when the check found
821# the cell above 255.
822def Parse.byte.checked(cell: U32, above: Bool, offset: Nat) -> Result<&2, &2, Error, Digits.Digits(2n)>:
823 match above:
824 case True{}:
825 Fail{InvalidByte{offset}}
826 case False{}:
827 Done{Digits.Digits.of_byte(cell)}