list-util (original) (raw)

8.15

1 List Utilities🔗ℹ

(make-list len elem) → (Listof A)
len : Integer
elem : A

(All (a) Integer a -> (Listof a))

Create a list of length len by repeating the provided elem as necessary.

(weave elem lst) → (Listof A)
elem : A
lst : (Listof A)

(All (a) a (Listof a) -> (Listof a))

Weave an element strictly between two elements of the lst.

(zip as bs) → (Listof (Pair A B))
as : (Listof A)
bs : (Listof B)

(All (A B) (Listof A) (Listof B) -> (Listof (Pair A B)))

Return a list formed by pairing element by element from the two provided lists. The length of the returned list will be the same length of the shortest of the provided lists.