aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gleam/list.gleam4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index 5cfe4a5..283bb3f 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -1473,9 +1473,7 @@ pub fn sized_chunk(in list: List(a), into count: Int) -> List(List(a)) {
pub fn reduce(over list: List(a), with fun: fn(a, a) -> a) -> Result(a, Nil) {
case list {
[] -> Error(Nil)
- [head, ..tail] ->
- fold(tail, head, fun)
- |> Ok
+ [head, ..tail] -> Ok(fold(tail, head, fun))
}
}