Skip to content

Commit

Permalink
feature: add narrow operator to Http (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath authored Mar 27, 2022
1 parent 57e576b commit 0a5c0c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zio-http/src/main/scala/zhttp/http/Http.scala
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,12 @@ sealed trait Http[-R, +E, -A, +B] extends (A => ZIO[R, Option[E], B]) { self =>
final def widen[E1, B1](implicit e: E <:< E1, b: B <:< B1): Http[R, E1, A, B1] =
self.asInstanceOf[Http[R, E1, A, B1]]

/**
* Narrows the type of the input
*/
final def narrow[A1](implicit a: A1 <:< A): Http[R, E, A1, B] =
self.asInstanceOf[Http[R, E, A1, B]]

/**
* Combines the two apps and returns the result of the one on the right
*/
Expand Down

0 comments on commit 0a5c0c8

Please sign in to comment.