Skip to content

Commit 2a001af

Browse files
committed
Issue #934 - Make Eval covariant
1 parent d1b87a6 commit 2a001af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/scala/cats/Eval.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import cats.syntax.all._
3333
* Eval instance -- this can defeat the trampolining and lead to stack
3434
* overflows.
3535
*/
36-
sealed abstract class Eval[A] extends Serializable { self =>
36+
sealed abstract class Eval[+A] extends Serializable { self =>
3737

3838
/**
3939
* Evaluate the computation and return an A value.
@@ -279,7 +279,7 @@ object Eval extends EvalInstances {
279279
cc.start().asInstanceOf[L],
280280
cc.run.asInstanceOf[C] :: c.run.asInstanceOf[C] :: fs)
281281
case xx =>
282-
loop(c.run(xx.value).asInstanceOf[L], fs)
282+
loop(c.run(xx.value), fs)
283283
}
284284
case x =>
285285
fs match {
@@ -350,7 +350,7 @@ trait EvalMonoid[A] extends Monoid[Eval[A]] with EvalSemigroup[A] {
350350
trait EvalGroup[A] extends Group[Eval[A]] with EvalMonoid[A] {
351351
implicit def algebra: Group[A]
352352
def inverse(lx: Eval[A]): Eval[A] =
353-
lx.map(_.inverse)
353+
lx.map(_.inverse())
354354
override def remove(lx: Eval[A], ly: Eval[A]): Eval[A] =
355355
for { x <- lx; y <- ly } yield x |-| y
356356
}

0 commit comments

Comments
 (0)