Skip to content

Commit

Permalink
Add ifF on Functor #3040 - by name parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vasiliybondarenko committed Sep 14, 2019
1 parent 5f8b2f4 commit 167eae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/Functor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ import simulacrum.typeclass
* res0: List[Int] = List(1, 0, 0)
* }}}
*/
def ifF[A](fb: F[Boolean])(ifTrue: A, ifFalse: A): F[A] = map(fb)(x => if (x) ifTrue else ifFalse)
def ifF[A](fb: F[Boolean])(ifTrue: => A, ifFalse: => A): F[A] = map(fb)(x => if (x) ifTrue else ifFalse)

def compose[G[_]: Functor]: Functor[λ[α => F[G[α]]]] =
new ComposedFunctor[F, G] {
Expand Down

0 comments on commit 167eae8

Please sign in to comment.