def fit_words

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

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

417def fit_words(dims: List<&2, U32>, values: List<&2, U32>) -> Bool:
418  match dims values:
419    case Nil{} Nil{}:
420      True{}
421    case dh <> dt vh <> vt:
422      Bool.and(Nat.is_lt(U32.to_nat(vh), U32.to_nat(dh)), fit_words(dt, vt))
423    case Nil{} vh <> vt:
424      False{}
425    case dh <> dt Nil{}:
426      False{}

Uses (6)

Used by (16)