def take

bend-collections@1.0.0.0 · src/crypto/chacha/chacha20.bend:120

import bend-collections@1.0.0.0/src/crypto/chacha/chacha20.bend as Chacha20
import 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)

Uses (3)

Used by (4)