def increasing

bend-visgraph@2.0.0.0 · src/series.bend:89

import bend-visgraph@2.0.0.0/src/series.bend as Series
import Base

89# Whether each value of `rest`, last first, is below `a`, as ts2vg checks
90# that x increases.
91def increasing(rest: List<&2, F32>, +a: F32, ok: Bool) -> Bool:
92  match rest:
93    case Nil{}:
94      ok
95    case Con{+b, t}:
96      increasing(t, b, ok && Bool.not(F32.is_le(F32.sub(a, b), 0.0)))

Uses (7)

Used by (1)