Adds a new LiftTrans typeclass#853
Conversation
This typeclass adds a `liftT` function which is similar to the liftM function on the scalaz MonadTrans typeclass, however this one takes into account that you might not need the power of a monad in order to be able to lift into a transformer, for example, we are able to Lift any M[A] into a Kleisli[M, B, A] regardless of whether or not M is a Monad, Functor, or any other such thing. Thish would be useful in cases where you are constructing an applicative computation using values for which you don't have a monad.
Current coverage is
|
There was a problem hiding this comment.
Do we need an Unapply version here?
|
Excellent work, @stew. This is better than what I came up with yesterday and was planning on submitting via PR today. 👍 in general. I left some minor comments that don't necessarily need to be addressed in this PR. |
|
I'm stuck on getting this to work for Validation. I'd love for other ideas, or to see what @ceedubs has on this, or just merge this and say "tough luck, more type lambdas" to people ;) |
|
What's Validation? ;) My current inclination is to merge this and say "tough luck, more type lambdas". But I'm also interested in exploring a bit more in this area. I'd say 👍 for a merge but we shouldn't feel set in stone on this approach. |
|
👍 , leaving |
Adds a new LiftTrans typeclass
This typeclass adds a
liftTfunction which is similar to the liftMfunction on the scalaz MonadTrans typeclass, however this one takes into
account that you might not need the power of a monad in order to be able
to lift into a transformer, for example, we are able to Lift any M[A]
into a Kleisli[M, B, A] regardless of whether or not M is a Monad,
Functor, or any other such thing. Thish would be useful in cases where
you are constructing an applicative computation using values for which
you don't have a monad.