Skip to content

Commit 0c41552

Browse files
pendletonglpil
authored andcommitted
fix: Reworked naming
1 parent c17ef52 commit 0c41552

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/gleam/list.gleam

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,30 +1839,30 @@ pub fn permutations(list: List(a)) -> List(List(a)) {
18391839
}
18401840
}
18411841

1842-
fn zipper(l: List(a), r: List(a), acc: List(List(a))) -> List(List(a)) {
1843-
case l {
1842+
fn zipper(list: List(a), rest: List(a), acc: List(List(a))) -> List(List(a)) {
1843+
case list {
18441844
[] -> reverse(acc)
1845-
[h, ..rest] ->
1846-
zipprepend(
1847-
h,
1848-
permutations(reverse_and_prepend(r, rest)),
1849-
rest,
1850-
[h, ..r],
1845+
[el, ..tail] ->
1846+
zip_prepend(
1847+
el,
1848+
permutations(reverse_and_prepend(rest, tail)),
1849+
tail,
1850+
[el, ..rest],
18511851
acc,
18521852
)
18531853
}
18541854
}
18551855

1856-
fn zipprepend(
1856+
fn zip_prepend(
18571857
el: a,
1858-
l1: List(List(a)),
1859-
l2: List(a),
1860-
l3: List(a),
1858+
permutations: List(List(a)),
1859+
list_1: List(a),
1860+
list_2: List(a),
18611861
acc: List(List(a)),
18621862
) -> List(List(a)) {
1863-
case l1 {
1864-
[] -> zipper(l2, l3, acc)
1865-
[h, ..rest] -> zipprepend(el, rest, l2, l3, [[el, ..h], ..acc])
1863+
case permutations {
1864+
[] -> zipper(list_1, list_2, acc)
1865+
[h, ..rest] -> zip_prepend(el, rest, list_1, list_2, [[el, ..h], ..acc])
18661866
}
18671867
}
18681868

0 commit comments

Comments
 (0)