Skip to content

Commit

Permalink
Renamed add to andThen
Browse files Browse the repository at this point in the history
  • Loading branch information
jiveshungerford committed Dec 13, 2023
1 parent e9b3e87 commit 4861c9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kyo-core/shared/src/main/scala/kyo/layers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object layers {
trait Layer[In, Out] { self =>
def run[T, S](effect: T > (In with S))(implicit fl: Flat[T > (In with S)]): T > (S with Out)

final def add[Out1, In1](other: Layer[In1, Out1]): Layer[In with In1, Out with Out1] =
final def andThen[Out1, In1](other: Layer[In1, Out1]): Layer[In with In1, Out with Out1] =
new Layer[In with In1, Out with Out1] {
override def run[T, S](
effect: T > (In with In1 with S)
Expand Down
4 changes: 2 additions & 2 deletions kyo-core/shared/src/test/scala/kyoTest/layersTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class layersTest extends KyoTest {
val dep3Layer = Envs[Dep3].layer(Envs[Dep].get.map(v => Dep3(v.dep3)))

"Envs layers should be composable and provide multiple dependencies" in {
val layer = (dep1Layer add dep2Layer add dep3Layer) chain depLayer
val layer = (dep1Layer andThen dep2Layer andThen dep3Layer) chain depLayer

val effect = for {
dep1 <- Envs[Dep1].get
Expand All @@ -46,7 +46,7 @@ class layersTest extends KyoTest {

"Aborts layers should be composable and handle multiple error types" in {
val layer =
(stringToTE1Layer add dep1ToTE1Layer add throwableToTE1Layer) chain testError1ToTE2Layer
(stringToTE1Layer andThen dep1ToTE1Layer andThen throwableToTE1Layer) chain testError1ToTE2Layer

val effect1 = for {
_ <- Aborts[String].fail("string failure")
Expand Down

0 comments on commit 4861c9e

Please sign in to comment.