Skip to content

Commit

Permalink
use val instead of def for type-class instances
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Jul 26, 2021
1 parent f8dc382 commit 2c24a2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shared/src/main/scala/org/atnos/eff/Choose.scala
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ object Rand {
def none[A]: Rand[A] =
Rand(_ => None)

implicit def MonadCombineRandom: Alternative[Rand] = new Alternative[Rand] with Monad[Rand] {
implicit val MonadCombineRandom: Alternative[Rand] = new Alternative[Rand] with Monad[Rand] {
def pure[A](x: A): Rand[A] = Rand(_ => Option(x))

def empty[A]: Rand[A] = Rand.none[A]
Expand Down
4 changes: 2 additions & 2 deletions shared/src/main/scala/org/atnos/eff/FutureEffect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final case class TimedFuture[A](callback: (Scheduler, ExecutionContext) => Futur

object TimedFuture {

final def ApplicativeTimedFuture: Applicative[TimedFuture] = new Applicative[TimedFuture] {
final val ApplicativeTimedFuture: Applicative[TimedFuture] = new Applicative[TimedFuture] {
def pure[A](x: A): TimedFuture[A] =
TimedFuture((_, _) => Future.successful(x))

Expand All @@ -41,7 +41,7 @@ object TimedFuture {
override def toString = "Applicative[TimedFuture]"
}

implicit final def MonadTimedFuture: MonadError[TimedFuture, Throwable] = new MonadError[TimedFuture, Throwable] {
implicit final val MonadTimedFuture: MonadError[TimedFuture, Throwable] = new MonadError[TimedFuture, Throwable] {
def pure[A](x: A): TimedFuture[A] =
TimedFuture((_, _) => Future.successful(x))

Expand Down

0 comments on commit 2c24a2e

Please sign in to comment.