def take
import bend-collections-laws-math@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 (13)
- bend-collections-laws-math@1.0.0.0/proofs/lib/list:sc_take_zero
- bend-collections-laws-math@1.0.0.0/proofs/lib/list:sc_length_take
- bend-collections-laws-math@1.0.0.0/proofs/lib/list:sc_drop_take
- bend-collections-laws-math@1.0.0.0/proofs/lib/list:sc_nth_take
- bend-collections-laws-math@1.0.0.0/proofs/lib/list:sc_take_append_left
- …