def take
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as Commonimport Base
154def take(-A: Data, xs: List<&2, A>, n: Nat) -> List<&2, A>:
155 match xs n:
156 case Nil{} _:
157 Nil{}
158 case Con{h, t} 0n:
159 Nil{}
160 case Con{h, t} 1n+p:
161 Con{h, take(A, t, p)}
Uses (2)
Used by (37)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/blake/blake3:tree
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/argon2/memory:tree
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/argon2/memory:slice
- bend-collections-laws-crypto@1.0.0.0/proofs/lib/list:sc_take_zero
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/argon2/memory:take_all
- …