def Deque.count
import bend-kit-collections@0.1.4.1/deque.bend as Dequeimport Base
36# a list and its length, in one pass that hands the list back
37def Deque.count(a, -A: Kind(a), xs: List<a, A>) -> List<a, A> & Nat:
38 match xs:
39 case Nil{}:
40 (Nil{}, 0n)
41 case h <> t:
42 Deque.count.put(a, A, h, Deque.count(a, A, t))