Skip to content
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

Adds a new LiftTrans typeclass #853

Merged
merged 1 commit into from
Feb 10, 2016
Merged

Conversation

stew
Copy link
Contributor

@stew stew commented Feb 2, 2016

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.

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.
@stew stew mentioned this pull request Feb 2, 2016
@codecov-io
Copy link

Current coverage is 89.34%

Merging #853 into master will increase coverage by +0.07% as of 9c377c2

@@            master    #853   diff @@
======================================
  Files          168     169     +1
  Stmts         2322    2336    +14
  Branches        75      75       
  Methods          0       0       
======================================
+ Hit           2073    2087    +14
  Partial          0       0       
  Missed         249     249       

Review entire Coverage Diff as of 9c377c2

Powered by Codecov. Updated on successful CI builds.

package syntax

trait TransLiftSyntax {
implicit def transLiftSyntax[M[_], A](ma: M[A]): TransLiftOps[M, A] = new TransLiftOps(ma)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an Unapply version here?

@ceedubs
Copy link
Contributor

ceedubs commented Feb 2, 2016

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.

@stew
Copy link
Contributor Author

stew commented Feb 5, 2016

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 ;)

@ceedubs
Copy link
Contributor

ceedubs commented Feb 5, 2016

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.

@adelbertc
Copy link
Contributor

👍 , leaving Unapply for future work

adelbertc added a commit that referenced this pull request Feb 10, 2016
Adds a new LiftTrans typeclass
@adelbertc adelbertc merged commit 6dbd4b0 into typelevel:master Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants