Skip to content

Commit

Permalink
covariant all leafs of eval
Browse files Browse the repository at this point in the history
  • Loading branch information
yanns committed Sep 2, 2024
1 parent 8bfaab5 commit 94526a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Eval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ sealed abstract class Eval[+A] extends Serializable { self =>
* This type should be used when an A value is already in hand, or
* when the computation to produce an A value is pure and very fast.
*/
final case class Now[A](value: A) extends Eval.Leaf[A] {
final case class Now[+A](value: A) extends Eval.Leaf[A] {
def memoize: Eval[A] = this
}

Expand Down Expand Up @@ -190,7 +190,7 @@ object Later {
* required. It should be avoided except when laziness is required and
* caching must be avoided. Generally, prefer Later.
*/
final class Always[A](f: () => A) extends Eval.Leaf[A] {
final class Always[+A](f: () => A) extends Eval.Leaf[A] {
def value: A = f()
def memoize: Eval[A] = new Later(f)
}
Expand Down

0 comments on commit 94526a9

Please sign in to comment.