Fixed.digit_on: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/spec/math/fixed.bend as Fixed Lines 229-240 of bend-collections-laws-math@1.0.0.0/spec/math/fixed.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/fixed.bend&start_line=229&end_line=240 import Base import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as C # the value of exactly k base-256 digits, least significant first; None # for another length or a digit of 256 or more def digit_on(r: Maybe<&2, Nat>, ok: Bool, +x: Nat) -> Maybe<&2, Nat>: match r: case Some{+v}: match ok: case True{}: Some{Nat.add(x, C.shift(8n, v))} case False{}: None{} case None{}: None{} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/common.bend&name=shift