def address_when
import stelliferous@0.0.2.0/tensor_view.bend as TensorViewimport Base
14# Successful addresses are below logical_length. The checked product and the
15# remaining-room comparison prevent multiplication and addition from wrapping.
16def address_when(valid: Bool,offset: U32,increment: U32) -> Maybe<&2,U32>:
17 match valid:
18 case False{}: None{}
19 case True{}: Some{(offset + increment : U32)}