def count
import bend-kit-concurrency@0.2.0.0/concurrency.bend as Concurrencyimport 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))