Skip to content

Commit

Permalink
Change BIO.fromOption signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasil committed May 17, 2020
1 parent 1aff73a commit 1501ba8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/shared/src/main/scala/monix/bio/BIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1501ba8

Please sign in to comment.