def roots

bend-lint-rules@0.2.0.0 · language/decreasing_call.bend:64

import bend-lint-rules@0.2.0.0/language/decreasing_call.bend as DecreasingCall
import Base
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists

64# The roots that `binder` is smaller than, with `binder` itself.
65def roots(smaller: List<&2, Smaller>, +binder: U32, out: List<&2, U32>) -> List<&2, U32>:
66  match smaller:
67    case Nil{}:
68      binder <> out
69    case Con{Smaller{r, f}, rest}:
70      roots(rest, binder, Lists.push(U32, Lists.when(U32, U32.is_eq(f, binder), r), out))

Uses (6)

Used by (1)