diff --git a/kyo-core/shared/src/main/scala/kyo/layers.scala b/kyo-core/shared/src/main/scala/kyo/layers.scala index 4241e4a34..8ff8da25b 100644 --- a/kyo-core/shared/src/main/scala/kyo/layers.scala +++ b/kyo-core/shared/src/main/scala/kyo/layers.scala @@ -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) diff --git a/kyo-core/shared/src/test/scala/kyoTest/layersTest.scala b/kyo-core/shared/src/test/scala/kyoTest/layersTest.scala index 59ba8bb09..d7951ee77 100644 --- a/kyo-core/shared/src/test/scala/kyoTest/layersTest.scala +++ b/kyo-core/shared/src/test/scala/kyoTest/layersTest.scala @@ -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 @@ -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")