Add toEither to OptionSyntax
kevin-lee opened this issue · comments
Kevin Lee commented
Task
Summary
Add toEither
to OptionSyntax
.
Project Details
Version: 1.1.0
Description
val maybeN = 1.some // Option[Int] = Some(1)
maybeN.toEither("Something wrong") // Either[String, Int] = Right(1)
val maybeN2 = none[Int] // Option[Int] = None
maybeN2.toEither("Something wrong") // Either[String, Int] = Left("Something wrong")