-
-
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 StateT transformS #780
Conversation
Current coverage is
|
👍 |
@@ -73,6 +73,20 @@ final class StateT[F[_], S, A](val runF: F[S => F[(S, A)]]) extends Serializable | |||
def transformF[G[_], B](f: F[(S, A)] => G[(S, B)])(implicit F: FlatMap[F], G: Applicative[G]): StateT[G, S, B] = | |||
StateT(s => f(run(s))) | |||
|
|||
/** Transform the state used |
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.
Unjustifiably nitpicky: could you bump "Transform..." down to the next line to be consistent with the other ScalaDoc comments?
Also, what do you think about adding an sbt-doctest example here?
* scala> xt.run((input, "hello")) | ||
* res1: Option[(GlobalEnv, Double)] = Some(((6,hello),5.0)) | ||
* }}} | ||
*/ |
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.
Love it.
👍 |
No description provided.