Maybe

scalus.prelude.Maybe
See theMaybe companion enum
object Maybe

Attributes

Companion
enum
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Maybe.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

inline def apply[A](x: A): Maybe[A]

Constructs a Maybe from a value. If the value is null, it returns Nothing, otherwise Just(value).

Constructs a Maybe from a value. If the value is null, it returns Nothing, otherwise Just(value).

Attributes

def fromOption[A](o: Option[A]): Maybe[A]

Converts an Option to a Maybe

Converts an Option to a Maybe

Attributes

Givens

Givens

given maybeEq[A](using eq: () => A): () => Maybe[A]

Extensions

Extensions

extension [A](m: Maybe[A])
def map[B](f: A => B): Maybe[B]
def toOption: Option[A]

Converts a Maybe to an Option

Converts a Maybe to an Option

Attributes