Skip to content

Commit

Permalink
Removing Lazy from ResultMatcher in HLTF to fix issue http4s#216
Browse files Browse the repository at this point in the history
  • Loading branch information
zarthross committed Jan 20, 2019
1 parent 0bd6db2 commit b593c27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/main/scala/org/http4s/rho/bits/HListToFunc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ trait MatchersHListToFunc[F[_]] {
}

/** Converter for types `FunctionN` to an `HList` */
implicit def instance[T <: HList, TR <: HList, FU, R](implicit F: Monad[F], fp: FnToProduct.Aux[FU, TR => R], rev: Reverse.Aux[T, TR], m: Lazy[ResultMatcher[F, R]]): HListToFunc[F, T, FU] = new MatcherHListToFunc[T, FU] {
override def matcher: ResultMatcher[F, R] = m.value
implicit def instance[T <: HList, TR <: HList, FU, R](implicit F: Monad[F], fp: FnToProduct.Aux[FU, TR => R], rev: Reverse.Aux[T, TR], m: ResultMatcher[F, R]): HListToFunc[F, T, FU] = new MatcherHListToFunc[T, FU] {
override def matcher: ResultMatcher[F, R] = m
override def conv(f: FU): (Request[F], T) => F[Response[F]] = (req: Request[F], h: T) => { matcher.conv(req, f.toProduct(rev(h))) }
}

/** Converter for types `FunctionN` where the first element is a `Request` to an `HList` */
implicit def instance1[T <: HList, TR <: HList, FU, R](implicit F: Monad[F], fp: FnToProduct.Aux[FU, Request[F] :: TR => R], rev: Reverse.Aux[T, TR], m: Lazy[ResultMatcher[F, R]]): HListToFunc[F, T, FU] = new MatcherHListToFunc[T, FU] {
override def matcher: ResultMatcher[F, R] = m.value
implicit def instance1[T <: HList, TR <: HList, FU, R](implicit F: Monad[F], fp: FnToProduct.Aux[FU, Request[F] :: TR => R], rev: Reverse.Aux[T, TR], m: ResultMatcher[F, R]): HListToFunc[F, T, FU] = new MatcherHListToFunc[T, FU] {
override def matcher: ResultMatcher[F, R] = m
override def conv(f: FU): (Request[F], T) => F[Response[F]] = (req: Request[F], h: T) => { matcher.conv(req, f.toProduct(req :: rev(h))) }
}

Expand Down

0 comments on commit b593c27

Please sign in to comment.