def walk_left

bendtorch-core@0.1.0.0 · src/shape/core.bend:446

import bendtorch-core@0.1.0.0/src/shape/core.bend as Core
import Base

446def walk_left(rows: List<&2, Row>, +index: Nat) -> Nat:
447  match rows:
448    case Nil{}:
449      0n
450    case Row{+stride, left, right} <> rest:
451      Nat.add(Nat.mul(left, Nat.div(index, stride)), walk_left(rest, Nat.mod(index, stride)))

Uses (7)

Used by (23)