We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some people have already stumbled upon this in the wild: <+> syntax doesn't work for AuthedService (also referenced in #1501).
<+>
The issue boils down to
type AuthedService[F[_], T] = Kleisli[OptionT[F, ?], AuthedRequest[F, T], Response[F]]
having T on the right, which prevents partial unification from triggering.
T
Minimisation:
object Gotcha { import cats._, data._, implicits._ implicit def http4sKleisliSemigroupK[F[_]: SemigroupK, A]: SemigroupK[Kleisli[F, A, ?]] = new SemigroupK[Kleisli[F, A, ?]] { def combineK[B](x: Kleisli[F, A, B], y: Kleisli[F, A, B]) = Kleisli(req => x(req) <+> y(req)) } case class Req[F[_]]() case class Res[F[_]]() type Service[F[_]] = Kleisli[OptionT[F, ?], Req[F], Res[F]] def normal[F[_]: Monad](a: Service[F], b: Service[F]) = a <+> b case class AuthedReq[F[_], T]() type AuthedService[F[_], T] = Kleisli[OptionT[F, ?], AuthedReq[F, T], Res[F]] type AuthedServiceSwapped[T, F[_]] = Kleisli[OptionT[F, ?], AuthedReq[F, T], Res[F]] // def doesNotCompile[F[_]: Monad, T](a: AuthedService[F, T], b: AuthedService[F, T]) = // a <+> b def compiles[F[_]: Monad, T](a: AuthedServiceSwapped[T, F], b: AuthedServiceSwapped[T, F]) = a <+> b }
I'll PR a fix for this asap
The text was updated successfully, but these errors were encountered:
AuthedService
AuthedRoutes
Successfully merging a pull request may close this issue.
Some people have already stumbled upon this in the wild:
<+>
syntax doesn't work for AuthedService (also referenced in #1501).The issue boils down to
having
T
on the right, which prevents partial unification from triggering.Minimisation:
I'll PR a fix for this asap
The text was updated successfully, but these errors were encountered: