Conversions

steps.result.Conversions
object Conversions

Defines possible implicit conversions into Result from various types.

// for conversions from `Either` and `scala.util.Try`
import Conversions.FromScala.given
// for conversions from `Option` into `Result[T, ResultIsErrException]`
import Conversions.FromOption.given
// for implicit lifting from any type `T` into `Result[T, Nothing]`
import Conversions.Lift.given

Additionally, import Conversions.Compat.given provides an instance of Conversion[T, T] to aid with using Result.eval functions.

import Conversions.Compat.given

val ok: Result[Int, String] = Ok(3)
Result[Int, Any]:
 ok.? // Ok, Conversion[String, Any] is present

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

object Compat

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Compat.type
object FromOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
FromOption.type
object FromScala

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
FromScala.type
object Lift

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Lift.type