Skip to content

Commit

Permalink
add explicit types
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Apr 30, 2023
1 parent a1d5fcd commit da3429e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions shared/src/main/scala/org/atnos/eff/Batch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ private object Batched {
}

private case class Composed[T[_]](unbatched: Vector[Batched[T]], batched: Single[T]) extends Batched[T] {
def effects = unbatched.flatMap(_.effects)
def keys = unbatched.flatMap(_.keys) ++ batched.keys
def effects: Vector[T[_]] = unbatched.flatMap(_.effects)
def keys: Vector[Int] = unbatched.flatMap(_.keys) ++ batched.keys
def batchedEffect: T[_] = batched.batchedEffect

def append(ty: T[_], key: Int) =
def append(ty: T[_], key: Int): Batched[T] =
copy(unbatched = unbatched :+ Batched.single[T, Any]((ty.asInstanceOf[T[Any]], key)))

def fuse(ty: T[_], key: Int) =
def fuse(ty: T[_], key: Int): Batched[T] =
copy(batched = Single(ty, batched.keys :+ key))
}

private case class Single[T[_]](tx: T[_], keys: Vector[Int]) extends Batched[T] {
def effects = Vector(tx)
def effects: Vector[T[_]] = Vector(tx)
def batchedEffect = tx

def append(ty: T[_], key: Int): Batched[T] =
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/org/atnos/eff/StateEffect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trait StateImplicits {
implicit def stateMemberInLens[E, S, T](implicit m: MemberIn[State[S, *], E], get: S => T, set: T => S => S): MemberIn[State[T, *], E] =
m.transform(via(get, set))

def readerToStateNat[S1] = new (Reader[S1, *] ~> State[S1, *]) {
def readerToStateNat[S1]: Reader[S1, *] ~> State[S1, *] = new (Reader[S1, *] ~> State[S1, *]) {
def apply[X](r: Reader[S1, X]): State[S1, X] =
State((s: S1) => (s, r.run(s)))
}
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/org/atnos/eff/SubscribeEffect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object SubscribeEffect {

type FS = Fx.fx1[Subscribe]

def subscribeToAttemptedSubscribe = new (Subscribe ~> AttemptedSubscribe) {
def subscribeToAttemptedSubscribe: Subscribe ~> AttemptedSubscribe = new (Subscribe ~> AttemptedSubscribe) {

def apply[X](subscribe: Subscribe[X]): AttemptedSubscribe[X] =
AttemptedSubscribe((c: Callback[Throwable Either X]) => subscribe((tx: Throwable Either X) => c(Right(tx))))
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/org/atnos/eff/Unions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ case class Unions[R, A](first: Union[R, A], rest: Vector[Union[R, Any]]) {
}

object Unions {
def send[M[_], R, X](mx: M[X])(implicit m: MemberIn[M, R]) =
def send[M[_], R, X](mx: M[X])(implicit m: MemberIn[M, R]): Unions[R, X] =
Unions[R, X](m.inject(mx), Vector.empty)
}

Expand Down

0 comments on commit da3429e

Please sign in to comment.