def address_when

stelliferous@0.0.2.0 · tensor_view.bend:14

import stelliferous@0.0.2.0/tensor_view.bend as TensorView
import 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)}

Uses (4)

Used by (2)