def take
import bend-collections@1.0.0.0/src/crypto/chacha/chacha20.bend as Chacha20import Base
120def take(n: Nat, xs: List<&2, U32>) -> List<&2, U32>:
121 match n xs:
122 case 0n _: Nil{}
123 case 1n+p Nil{}: Nil{}
124 case 1n+p x <> rest: x <> take(p, rest)