diff options
author | Sebastian <s@porto5.com> | 2021-01-13 22:33:58 +1100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2021-01-13 17:01:09 +0000 |
commit | 35d5c737e0e1d4c32ec96034dacdcc8303c6caf7 (patch) | |
tree | 146a78b28d5f68c9f15e6164247187b376769868 /src | |
parent | 107ce9bc60cb971c44a02648bef232336fbbdbf3 (diff) | |
download | gleam_stdlib-35d5c737e0e1d4c32ec96034dacdcc8303c6caf7.tar.gz gleam_stdlib-35d5c737e0e1d4c32ec96034dacdcc8303c6caf7.zip |
Rename helper function to do_index_fold
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/list.gleam | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index 32d6675..9db8967 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -454,11 +454,11 @@ pub fn fold_right(list: List(a), from initial: b, with fun: fn(a, b) -> b) -> b } } -fn index_fold_(over: List(a), acc: b, with: fn(Int, a, b) -> b, index: Int) -> b { +fn do_index_fold(over: List(a), acc: b, with: fn(Int, a, b) -> b, index: Int) -> b { case over { [] -> acc [first, ..rest] -> - index_fold_(rest, with(index, first, acc), with, index + 1) + do_index_fold(rest, with(index, first, acc), with, index + 1) } } @@ -476,7 +476,7 @@ pub fn index_fold( from initial: b, with fun: fn(Int, a, b) -> b, ) -> b { - index_fold_(over, initial, fun, 0) + do_index_fold(over, initial, fun, 0) } /// A variant of fold that might fail. |