Skip to content

Commit 69d91a0

Browse files
committed
Exclude extra methods from Simulacrum syntax generation
1 parent 4f6d5c2 commit 69d91a0

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

core/src/main/scala/cats/FlatMap.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ import simulacrum.noop
117117
/**
118118
* `if` lifted into monad.
119119
*/
120+
@noop
120121
def ifM[B](fa: F[Boolean])(ifTrue: => F[B], ifFalse: => F[B]): F[B] =
121122
flatMap(fa)(if (_) ifTrue else ifFalse)
122123

core/src/main/scala/cats/Functor.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ import simulacrum.{noop, typeclass}
173173
* res0: List[Int] = List(1, 0, 0)
174174
* }}}
175175
*/
176+
@noop
176177
def ifF[A](fb: F[Boolean])(ifTrue: => A, ifFalse: => A): F[A] = map(fb)(x => if (x) ifTrue else ifFalse)
177178

178179
def compose[G[_]: Functor]: Functor[λ[α => F[G[α]]]] =

core/src/main/scala/cats/Monad.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cats
22

3-
import simulacrum.typeclass
3+
import simulacrum.{noop, typeclass}
44

55
/**
66
* Monad.
@@ -22,6 +22,7 @@ import simulacrum.typeclass
2222
* This implementation uses append on each evaluation result,
2323
* so avoid data structures with non-constant append performance, e.g. `List`.
2424
*/
25+
@noop
2526
def whileM[G[_], A](p: F[Boolean])(body: => F[A])(implicit G: Alternative[G]): F[G[A]] = {
2627
val b = Eval.later(body)
2728
tailRecM[G[A], G[A]](G.empty)(xs =>
@@ -41,6 +42,7 @@ import simulacrum.typeclass
4142
* returns `true`. The condition is evaluated before the loop body.
4243
* Discards results.
4344
*/
45+
@noop
4446
def whileM_[A](p: F[Boolean])(body: => F[A]): F[Unit] = {
4547
val continue: Either[Unit, Unit] = Left(())
4648
val stop: F[Either[Unit, Unit]] = pure(Right(()))

0 commit comments

Comments
 (0)