Skip to content

Commit

Permalink
layers: remove unnecessary type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Dec 19, 2023
1 parent 73ac1e2 commit 4c31b63
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions kyo-core/shared/src/main/scala/kyo/layers.scala
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@ object layers {
)(
implicit fl: Flat[T < (In with In1 with S)]
): T < (S with Out with Out1) = {
val selfRun: T < (In1 with Out with S) =
self.run[T, S with In1](effect: T < (In1 with In with S))
val otherRun: T < (Out with Out1 with S) =
val selfRun =
self.run[T, S with In1](effect)
val otherRun =
other.run[T, S with Out](selfRun)(Flat.unsafe.unchecked)
otherRun
}
@@ -49,9 +49,8 @@ object layers {
override def run[T, S](effect: T < (In1 with S))(implicit
fl: Flat[T < (In1 with S)]
): T < (S with Out2 with Out1) = {
val handled1: T < (S with Out1 with Shared) = layer1.run[T, S](effect)
val handled2: T < (S with Out2 with Out1) =
layer2.run[T, S with Out1](handled1)(Flat.unsafe.unchecked)
val handled1 = layer1.run[T, S](effect)
val handled2 = layer2.run[T, S with Out1](handled1)(Flat.unsafe.unchecked)
handled2
}
}
@@ -72,9 +71,8 @@ object layers {
override def run[T, S](effect: T < (In1 with S))(implicit
fl: Flat[T < (In1 with S)]
): T < (S with Out2) = {
val handled1: T < (S with Shared) = layer1.run[T, S](effect)
val handled2: T < (S with Out2) =
layer2.run[T, S](handled1)(Flat.unsafe.unchecked)
val handled1 = layer1.run[T, S](effect)
val handled2 = layer2.run[T, S](handled1)(Flat.unsafe.unchecked)
handled2
}
}
@@ -118,9 +116,8 @@ object layers {
override def run[T, S](effect: T < (In1 with S))(implicit
fl: Flat[T < (In1 with S)]
): T < (S with Out2) = {
val handled1: T < (Out with S) = layer1.run[T, S](effect)
val handled2: T < (S with Out2) =
layer2.run[T, S](handled1)(Flat.unsafe.unchecked)
val handled1 = layer1.run[T, S](effect)
val handled2 = layer2.run[T, S](handled1)(Flat.unsafe.unchecked)
handled2
}
}

0 comments on commit 4c31b63

Please sign in to comment.