Skip to content

Commit e82e02a

Browse files
sportolpil
authored andcommitted
Add over named arg for fold_right
1 parent 294c9a8 commit e82e02a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gleam/list.gleam

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ pub fn fold(over list: List(a), from initial: b, with fun: fn(a, b) -> b) -> b {
491491
/// Unlike `fold` this function is not tail recursive. Where possible use
492492
/// `fold` instead as it will use less memory.
493493
///
494-
pub fn fold_right(list: List(a), from initial: b, with fun: fn(a, b) -> b) -> b {
494+
pub fn fold_right(
495+
over list: List(a),
496+
from initial: b,
497+
with fun: fn(a, b) -> b,
498+
) -> b {
495499
case list {
496500
[] -> initial
497501
[x, ..rest] -> fun(x, fold_right(rest, initial, fun))

0 commit comments

Comments
 (0)