zio.blocks.maybe
Members list
Type members
Classlikes
Top-level singleton representing absence. case Absent matches via a stable-identifier pattern; both plain objects and case objects qualify as stable identifiers, so a plain object is used simply to avoid implying an Absent() extractor.
Top-level singleton representing absence. case Absent matches via a stable-identifier pattern; both plain objects and case objects qualify as stable identifiers, so a plain object is used simply to avoid implying an Absent() extractor.
Attributes
- Source
- Maybe.scala
- Supertypes
- Self type
-
Absent.type
This object was generated by sbt-buildinfo.
This object was generated by sbt-buildinfo.
Attributes
- Source
- BuildInfo.scala
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
BuildInfo.type
Attributes
- Source
- Maybe.scala
- Supertypes
- Self type
-
Maybe.type
Attributes
- Source
- MaybeCompat.scala
- Supertypes
Attributes
- Source
- MaybeSyntax.scala
- Supertypes
Attributes
- Source
- MaybeSyntax.scala
- Supertypes
- Known subtypes
-
trait MaybeCompat
Wraps a value so that "present of absent" is distinguishable from absent.
Wraps a value so that "present of absent" is distinguishable from absent.
Maybe[+A] is an opaque type alias for A | Absent.type | Present[A]. A plain non-absent value of type A is a present Maybe[A] with zero allocation; the Absent singleton is Maybe.absent; and Present(a) is a present Maybe[A] whose value is a — used to represent "present of absent" in nested Maybes (e.g. Maybe.present(Maybe.absent)), which a bare Absent cannot express.
NOTE on soundness: Maybe.present (and only present) wraps a user-supplied Present[_] argument in an extra Present layer (present(Present(x)) == Present(Present(x))). This ensures unsafeGet (used by codecs) returns the correct inner Present(x) without double-unwrapping. The public case Present(v) / case Absent matching idiom is unaffected.
Attributes
- Companion
- object
- Source
- Maybe.scala
- Supertypes
Attributes
- Companion
- class
- Source
- Maybe.scala
- Supertypes
- Self type
-
Present.type
Types
Attributes
- Source
- Maybe.scala
Inherited types
Attributes
- Inherited from:
- MaybeCompat
- Source
- MaybeCompat.scala