Skip to content

Commit ad97fe5

Browse files
giacomocavalierilpil
authored andcommitted
Add labels and clearer names to list.zip and list.zip_strict
1 parent f2edd4d commit ad97fe5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gleam/list.gleam

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,8 @@ fn do_zip(xs: List(a), ys: List(b), acc: List(#(a, b))) -> List(#(a, b)) {
982982
/// [#(1, 3), #(2, 4)]
983983
/// ```
984984
///
985-
pub fn zip(xs: List(a), ys: List(b)) -> List(#(a, b)) {
986-
do_zip(xs, ys, [])
985+
pub fn zip(list: List(a), with other: List(b)) -> List(#(a, b)) {
986+
do_zip(list, other, [])
987987
}
988988

989989
/// Takes two lists and returns a single list of 2-element tuples.
@@ -1013,11 +1013,11 @@ pub fn zip(xs: List(a), ys: List(b)) -> List(#(a, b)) {
10131013
/// ```
10141014
///
10151015
pub fn strict_zip(
1016-
l1: List(a),
1017-
l2: List(b),
1016+
list: List(a),
1017+
with other: List(b),
10181018
) -> Result(List(#(a, b)), LengthMismatch) {
1019-
case length(of: l1) == length(of: l2) {
1020-
True -> Ok(zip(l1, l2))
1019+
case length(of: list) == length(of: other) {
1020+
True -> Ok(zip(list, other))
10211021
False -> Error(LengthMismatch)
10221022
}
10231023
}

0 commit comments

Comments
 (0)