Maybe
Attributes
- Source
- Maybe.scala
- Graph
-
- Supertypes
- Self type
-
Maybe.type
Members list
Type members
Classlikes
Attributes
- Source
- Maybe.scala
- Supertypes
Value members
Concrete methods
Attributes
- Source
- Maybe.scala
Wraps a value in Maybe, treating null (and the Absent sentinel) as absent.
Wraps a value in Maybe, treating null (and the Absent sentinel) as absent.
Unlike present, apply collapses null/Absent to Maybe.absent. Use present when the value being wrapped is itself a Maybe that may be absent.
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Wraps a value in Maybe, preserving present-ness even for null or Absent.
Wraps a value in Maybe, preserving present-ness even for null or Absent.
A non-null/non-Absent value is returned as-is (zero allocation). A null value is wrapped as Present(null), and the Absent sentinel is wrapped as Present(Absent); both are distinguishable from Maybe.absent (the Absent singleton). This is what makes nested Maybes sound: Maybe.present(Maybe.absent) is Present(Absent), not Maybe.absent.
Special case for soundness (see Present scaladoc): if the argument is itself a Present[_], it is wrapped in an extra Present layer so that unsafeGet returns the original Present (preventing CCE when A = Present[T]). Normal present(v) for non-Present v remains zero-alloc.
Attributes
- Source
- Maybe.scala
Givens
Givens
Attributes
- Source
- Maybe.scala
Extensions
Extensions
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala
Attributes
- Source
- Maybe.scala