def count

bend-kit-concurrency@0.2.0.0 · concurrency.bend:22

import bend-kit-concurrency@0.2.0.0/concurrency.bend as Concurrency
import Base

22def count(-A: Type, xs: List<A>) -> Nat & List<A>:
23  match xs:
24    case Nil{}:
25      (0n, Nil{})
26    case h <> t:
27      count.cons(A, h, count(A, t))

Uses (5)

Used by (4)