Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions core/shared/src/main/scala/zio/ZLayer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ final class ZLayer[-RIn, +E, +ROut] private (
}
)

/**
* A named alias for `>>>`.
*/
def to[E1 >: E, ROut2](that: ZLayer[ROut, E1, ROut2]): ZLayer[RIn, E1, ROut2] =
self >>> that

/**
* Converts a layer that requires no services into a managed runtime, which
* can be used to execute effects.
Expand Down Expand Up @@ -2034,6 +2040,14 @@ object ZLayer {
): ZLayer[RIn with RIn2, E1, ROut with ROut2] =
self.zipWithPar(that)(_.unionAll[ROut2](_))

/**
* A named alias for `++`.
*/
def and[E1 >: E, RIn2, ROut1 >: ROut, ROut2 <: Has[_]](
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to delay further but I'm not sure they are alphabetized. I'll approve though!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they are but and just appears far down in the file because it is in the syntax class that provides evidence that the output type is a subtype of Has[_].

that: ZLayer[RIn2, E1, ROut2]
)(implicit tagged: Tagged[ROut2]): ZLayer[RIn with RIn2, E1, ROut1 with ROut2] =
self ++ that

/**
* Updates one of the services output by this layer.
*/
Expand Down