-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
Unable to use TransLift as a typeclass #1613
Comments
If you're willing to accept a def liftTTrans[F[_]: Monad, G[_[_], _]: TransLift.Aux[?[_[_], _], Monad]] =
λ[F ~> G[F, ?]](_.liftT[G]) Or at least, you should be able to. At present I don't actually think that will resolve, since it is effectively finding an instance of You would only need to use |
@djspiewak I can accept a This |
@wedens We need a bit more implicit machinery to allow stronger constraints to imply weaker ones. I'll give that some thought and see if I can implement it tomorrow. Shouldn't be too hard. |
I'm stepping aboard this canoe, if you don't mind. Trying to write a |
With
TransLift
I'm unable to use it as a typeclass forliftT
function for any transformer.With
MonadTrans
I was able to do it. For example to avoid boilerplate in defining typeclass instances for transformers:or for
liftT
as a natural transformation:it can be defined with
TransLift
asdef liftTT[F[_]: Monad, G[_[_], _], H[_[_]]](implicit G: TransLift.Aux[G, H], M: H[F]) = λ[F ~> G[F, ?]](x => G.liftT(x))
but this extra type parameterH
makes it useless.For
TransLift
to be useful in syntax it uses some scary thing TLExtract. I hope it's not expected to be used in other places whereTransLift
required as a typeclass.The text was updated successfully, but these errors were encountered: