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

Removed deprecation of >> and changed its param to be a by-name #2043

Merged
merged 3 commits into from
Nov 26, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,15 @@ def mimaSettings(moduleName: String) = Seq(
exclude[ReversedMissingMethodProblem]("cats.Foldable#Ops.collectFirst"),
exclude[ReversedMissingMethodProblem]("cats.NonEmptyParallel.parForEffect"),
exclude[ReversedMissingMethodProblem]("cats.NonEmptyParallel.parFollowedBy"),
exclude[ReversedMissingMethodProblem]("cats.syntax.ParallelSyntax.catsSyntaxParallelAp")
exclude[ReversedMissingMethodProblem]("cats.syntax.ParallelSyntax.catsSyntaxParallelAp"),
exclude[DirectMissingMethodProblem]("cats.FlatMap.>>="),
exclude[DirectMissingMethodProblem]("cats.FlatMap#Ops.>>="),
exclude[IncompatibleMethTypeProblem]("cats.syntax.FlatMapOps.>>"),
exclude[IncompatibleMethTypeProblem]("cats.syntax.FlatMapOps.>>$extension"),
exclude[DirectMissingMethodProblem]("cats.data.IndexedStateTMonad.>>="),
exclude[DirectMissingMethodProblem]("cats.data.RWSTMonad.>>="),
exclude[DirectMissingMethodProblem]("cats.data.CokleisliMonad.>>="),
exclude[DirectMissingMethodProblem]("cats.instances.FlatMapTuple2.>>=")
)
}
)
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/scala/cats/FlatMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ import simulacrum.typeclass
@typeclass trait FlatMap[F[_]] extends Apply[F] {
def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]

/**
* Alias for [[flatMap]].
*/
def >>=[A, B](fa: F[A])(f: A => F[B]): F[B] = flatMap(fa)(f)

/**
* "flatten" a nested `F` of `F` structure into a single-layer `F` structure.
*
Expand Down
15 changes: 13 additions & 2 deletions core/src/main/scala/cats/syntax/flatMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ trait FlatMapSyntax extends FlatMap.ToFlatMapOps {

final class FlatMapOps[F[_], A](val fa: F[A]) extends AnyVal {

@deprecated("Use *> instead", "1.0.0-RC1")
def >>[B](fb: F[B])(implicit F: FlatMap[F]): F[B] = F.followedBy(fa)(fb)
/**
* Alias for [[flatMap]].
*/
def >>=[B](f: A => F[B])(implicit F: FlatMap[F]): F[B] = F.flatMap(fa)(f)

/**
* Alias for `fa.flatMap(_ => fb)`.
*
* Unlike `*>`, `fb` is defined as a by-name parameter, allowing this
* method to be used in cases where computing `fb` is not stack safe
* unless suspended in a `flatMap`.
*/
def >>[B](fb: => F[B])(implicit F: FlatMap[F]): F[B] = F.flatMap(fa)(_ => fb)

@deprecated("Use <* instead", "1.0.0-RC1")
def <<[B](fb: F[B])(implicit F: FlatMap[F]): F[A] = F.forEffect(fa)(fb)
Expand Down