Skip to content

Commit

Permalink
Weaken the constraint for FOptionOps#flatMapOrKeepIn
Browse files Browse the repository at this point in the history
  • Loading branch information
danicheg committed Jun 15, 2024
1 parent 60a6250 commit daf1d9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/src/main/scala/mouse/foption.scala
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ final class FOptionOps[F[_], A](private val foa: F[Option[A]]) extends AnyVal {
def flatMapIn[B](f: A => Option[B])(implicit F: Functor[F]): F[Option[B]] =
F.map(foa)(_.flatMap(f))

def flatMapOrKeepIn[B >: A](pfa: PartialFunction[A, Option[B]])(implicit F: Monad[F]): F[Option[B]] =
def flatMapOrKeepIn[B >: A](pfa: PartialFunction[A, Option[B]])(implicit F: Functor[F]): F[Option[B]] =
F.map(foa)(_.flatMap(a => pfa.applyOrElse(a, Option[B](_))))

def flatMapF[B](f: A => F[Option[B]])(implicit F: Monad[F]): F[Option[B]] =

0 comments on commit daf1d9d

Please sign in to comment.