-
-
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
Deprecate FlatMap's >> and << #1955
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,4 @@ abstract class CartesianOps[F[_], A] extends Cartesian.Ops[F, A] { | |
final def |@|[B](fb: F[B]): CartesianBuilder[F]#CartesianBuilder2[A, B] = | ||
new CartesianBuilder[F] |@| self |@| fb | ||
|
||
final def *>[B](fb: F[B])(implicit F: Functor[F]): F[B] = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh. I see someone put them here originally. This was an error in my view. They should be on Apply. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah +1 on that :) |
||
F.map(typeClassInstance.product(self, fb)) { case (_, b) => b } | ||
|
||
final def <*[B](fb: F[B])(implicit F: Functor[F]): F[A] = | ||
F.map(typeClassInstance.product(self, fb)) { case (a, _) => a } | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,18 @@ trait FlatMapSyntax extends FlatMap.ToFlatMapOps { | |
|
||
implicit final def catsSyntaxFlatMapIdOps[A](a: A): FlatMapIdOps[A] = | ||
new FlatMapIdOps[A](a) | ||
|
||
implicit final def catsSyntaxFlatMapOps[F[_]: FlatMap, A](fa: F[A]): FlatMapOps[F, A] = | ||
new FlatMapOps[F, A](fa) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are untested, because of deprecation |
||
} | ||
|
||
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) | ||
|
||
@deprecated("Use <* instead", "1.0.0-RC1") | ||
def <<[B](fb: F[B])(implicit F: FlatMap[F]): F[A] = F.forEffect(fa)(fb) | ||
} | ||
|
||
final class FlattenOps[F[_], A](val ffa: F[F[A]]) extends AnyVal { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,13 +210,11 @@ All other symbols can be imported with `import cats.implicits._` | |
|
||
| Symbol | Name | Nickname | Type Class | Signature | | ||
| -------------------------------- | ---------------------- | ---------------- | ----------------------- | --------------------------------------------------------- | | ||
| `fa *> fb` | right apply | | `Cartesian[F[_]]` | `*>(fa: F[A])(fb: F[B]): F[B]` | | ||
| `fa <* fb` | left apply | | `Cartesian[F[_]]` | `<*(fa: F[A])(fb: F[B]): F[A]` | | ||
| `fa *> fb` | followed by | | `Apply[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | | ||
| `fa <* fb` | for effect | | `Apply[F[_]]` | `forEffect(fa: F[A])(fb: F[B]): F[A]` | | ||
| `x === y` | equals | | `Eq[A]` | `eqv(x: A, y: A): Boolean` | | ||
| `x =!= y` | not equals | | `Eq[A]` | `neqv(x: A, y: A): Boolean` | | ||
| `fa >>= f` | flatMap | | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]` | | ||
| `fa >> fb` | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | | ||
| `fa << fb` | for effect | | `FlatMap[F[_]]` | `forEffect(fa: F[A])(fb: F[B]): F[A]` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we not add them back to another place place in the doc? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added them at the bottom with a deprecated notice |
||
| <code>x |-| y</code> | remove | | `Group[A]` | `remove(x: A, y: A): A` | | ||
| `x > y` | greater than | | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | | ||
| `x >= y` | greater than or equal | | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | | ||
|
@@ -231,6 +229,8 @@ All other symbols can be imported with `import cats.implicits._` | |
| `F :≺: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | | ||
| `⊥` | bottom | | N/A | `Nothing` | | ||
| `⊤` | top | | N/A | `Any` | | ||
| `fa >> fb` (Deprecated) | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | | ||
| `fa << fb` (Deprecated) | for effect | | `FlatMap[F[_]]` | `forEffect(fa: F[A])(fb: F[B]): F[A]` | | ||
|
||
## <a id="contributing" href="#contributing"></a>How can I help? | ||
|
||
|
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.
This is untested because
<*
and<<
were before this PR.