From 1501ba86495367306f53d96d8692da1f3ca99ffd Mon Sep 17 00:00:00 2001 From: Avasil Date: Sun, 17 May 2020 19:28:30 +0200 Subject: [PATCH] Change BIO.fromOption signature --- core/shared/src/main/scala/monix/bio/BIO.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/shared/src/main/scala/monix/bio/BIO.scala b/core/shared/src/main/scala/monix/bio/BIO.scala index 22001041..18819fc5 100644 --- a/core/shared/src/main/scala/monix/bio/BIO.scala +++ b/core/shared/src/main/scala/monix/bio/BIO.scala @@ -3098,12 +3098,12 @@ object BIO extends TaskInstancesLevel0 { * {{{ * final case class NotFound() * - * BIO.fromOption(NotFound())(Some(1)) // <-> BIO.now(1)) - * BIO.fromOption(NotFound())(None) // <-> BIO.raiseError(NotFound()) + * BIO.fromOption(Some(1), NotFound()) // <-> BIO.now(1) + * BIO.fromOption(None, NotFound()) // <-> BIO.raiseError(NotFound()) * }}} * */ - def fromOption[E, A](ifEmpty: => E)(opt: Option[A]): BIO[E, A] = + def fromOption[E, A](opt: Option[A], ifEmpty: => E): BIO[E, A] = opt match { case None => BIO.suspendTotal(BIO.raiseError(ifEmpty)) case Some(v) => Now(v)