-
-
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
Add IdT, the identity monad transformer #588
Conversation
I don't see a |
Current coverage is
|
Thanks, @vikraman! I've never used |
I think |
Yes, I just ran into diverging implicits with this alias, I'll change it to a proper data type. |
Updated. |
Ditto to @ceedubs's question |
def map[B](f: A => B)(implicit F: Functor[F]): IdT[F, B] = | ||
IdT(F.map(value)(f)) | ||
|
||
def flatMap[B](f: A => IdT[F, B])(implicit F: Monad[F]): IdT[F, B] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be replace the constraint from Monad
to FlatMap
?
I think it is useful to have |
xuwei-k@5b426cc249bd1f46d92b8d2
|
Split the instances to avoid ambiguous implicits. |
Sorry for the long silence. I'm fine with merging this -- I do think we probably want to write a few more words about how it works (e.g. "If M[_] is a monad, then IdT[M, ?] provides an equivalent monad" or similar) but that can happen in a future PR. 👍 |
LGTM 👍 |
No description provided.