def split
import bend-kit-concurrency@0.2.0.0/concurrency.bend as Concurrencyimport Base
34def split(-A: Type, xs: List<A>, n: Nat) -> List<A> & List<A>:
35 match xs n:
36 case Nil{} _:
37 (Nil{}, Nil{})
38 case h <> t 0n:
39 (Nil{}, h <> t)
40 case h <> t 1n+p:
41 split.cons(A, h, split(A, t, p))