We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fb93934 + acb3a6c commit a80545aCopy full SHA for a80545a
library/src/scala/util/control/TailCalls.scala
@@ -37,7 +37,7 @@ package util.control
37
* if (n < 2) done(n) else for {
38
* x <- tailcall(fib(n - 1))
39
* y <- tailcall(fib(n - 2))
40
- * } yield (x + y)
+ * } yield x + y
41
*
42
* fib(40).result
43
* }}}
@@ -57,7 +57,7 @@ object TailCalls {
57
final def flatMap[B](f: A => TailRec[B]): TailRec[B] =
58
this match {
59
case Done(a) => Call(() => f(a))
60
- case c@Call(_) => Cont(c, f)
+ case c @ Call(_) => Cont(c, f)
61
// Take advantage of the monad associative law to optimize the size of the required stack
62
case c: Cont[a1, b1] => Cont(c.a, (x: a1) => c.f(x) flatMap f)
63
}
0 commit comments