mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2025-01-01 17:23:23 +03:00
Add replicate to base/Data.List.
This commit is contained in:
parent
ab98b4d3c9
commit
9190ccf883
@ -121,6 +121,13 @@ public export
|
||||
reverse : List a -> List a
|
||||
reverse = reverseOnto []
|
||||
|
||||
||| Construct a list with `n` copies of `x`.
|
||||
||| @ n how many copies
|
||||
||| @ x the element to replicate
|
||||
public export
|
||||
replicate : (n : Nat) -> (x : a) -> List a
|
||||
replicate Z _ = []
|
||||
replicate (S n) x = x :: replicate n x
|
||||
|
||||
||| Compute the intersect of two lists by user-supplied equality predicate.
|
||||
export
|
||||
|
Loading…
Reference in New Issue
Block a user