Skip to content

Commit

Permalink
Rename OptionT.flatTapNone's argument for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Heiber committed Apr 11, 2020
1 parent e3f83ab commit 468e4f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/data/OptionT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ final case class OptionT[F[_], A](value: F[Option[A]]) {
* Perform an effect if the value inside the is a `None`, leaving the value untouched. Equivalent to [[orElseF]]
* with an effect returning `None` as argument.
*/
def flatTapNone[B](f: => F[B])(implicit F: Monad[F]): OptionT[F, A] =
OptionT(F.flatTap(value)(_.fold(F.void(f))(_ => F.unit)))
def flatTapNone[B](ifNone: => F[B])(implicit F: Monad[F]): OptionT[F, A] =
OptionT(F.flatTap(value)(_.fold(F.void(ifNone))(_ => F.unit)))

def getOrElse[B >: A](default: => B)(implicit F: Functor[F]): F[B] =
F.map(value)(_.getOrElse(default))
Expand Down

0 comments on commit 468e4f7

Please sign in to comment.