From 78d1a06c9d8d5923960424fc0dfdb26cdfedfa77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Petr=C3=A1=C5=A1?= Date: Mon, 10 Jun 2024 18:54:07 +0200 Subject: Don't wait for next value in iterator.yield --- src/gleam/iterator.gleam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gleam/iterator.gleam b/src/gleam/iterator.gleam index e4d572a..ad655c4 100644 --- a/src/gleam/iterator.gleam +++ b/src/gleam/iterator.gleam @@ -1617,5 +1617,5 @@ pub fn each(over iterator: Iterator(a), with f: fn(a) -> b) -> Nil { /// ``` /// pub fn yield(element: a, next: fn() -> Iterator(a)) -> Iterator(a) { - Iterator(fn() { Continue(element, next().continuation) }) + Iterator(fn() { Continue(element, fn() { next().continuation() }) }) } -- cgit v1.2.3