Skip to content

Commit

Permalink
Fixed compilation error in 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Runar Bjarnason committed Apr 18, 2015
1 parent 617b927 commit 8440f61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion answers/src/main/scala/fpinscala/iomonad/Monad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait Monad[F[_]] extends Functor[F] {
def when[A](b: Boolean)(fa: => F[A]): F[Boolean] =
if (b) as(fa)(true) else unit(false)
def forever[A,B](a: F[A]): F[B] = {
val t: F[B] = a flatMap (_ => t)
lazy val t: F[B] = a flatMap (_ => t)
t
}
def while_(a: F[Boolean])(b: F[Unit]): F[Unit] = {
Expand Down
2 changes: 1 addition & 1 deletion exercises/src/main/scala/fpinscala/iomonad/Monad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait Monad[F[_]] extends Functor[F] {
def when[A](b: Boolean)(fa: => F[A]): F[Boolean] =
if (b) as(fa)(true) else unit(false)
def forever[A,B](a: F[A]): F[B] = {
val t: F[B] = a flatMap (_ => t)
lazy val t: F[B] = a flatMap (_ => t)
t
}
def while_(a: F[Boolean])(b: F[Unit]): F[Unit] = {
Expand Down

0 comments on commit 8440f61

Please sign in to comment.