Skip to content

Commit

Permalink
actually, there is no reason to make loopFn lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
johnynek committed Sep 22, 2024
1 parent 025867d commit e45b590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/Defer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ trait Defer[F[_]] extends Serializable {
*/
def recursiveFn[A, B](fn: (A => F[B]) => (A => F[B])): A => F[B] =
new Function1[A, F[B]] { self =>
lazy val loopFn: A => F[B] = fn(self)
val loopFn: A => F[B] = fn(self)

def apply(a: A): F[B] = defer(loopFn(a))
}
Expand Down

0 comments on commit e45b590

Please sign in to comment.