def onto

bend-lint-api@0.2.0.0 · shared/lists.bend:12

import bend-lint-api@0.2.0.0/shared/lists.bend as Lists
import Base

12# `xs`, last first, onto `out`.
13def onto(a, -A: Kind(a), xs: List<a, A>, out: List<a, A>) -> List<a, A>:
14  match xs:
15    case Nil{}:
16      out
17    case Con{h, t}:
18      onto(a, A, t, h <> out)

Uses (1)

Used by (29)