Std.Option
24 public declarations
- allPresent
&Array[Option[T]] -> Option[Array[T]]Every value if every one is present, otherwise nothing.
- andThen
Option[A] -> fn(A) -> Option[B] -> Option[B]The value transformed into another option, flattened.
- dropIf
Option[T] -> fn(T) -> Bool -> Option[T]The value if it is present, otherwise nothing, with the option discarded.
- exists
Option[T] -> BoolWhether a value is present, as a plain question about an owned value.
- firstPresent
&Array[Option[T]] -> Option[T]The first present value, or nothing when there is none.
- flatten
Option[Option[T]] -> Option[T]A nested option flattened by one level.
- fold
Option[A] -> fn(A) -> B -> B -> BThe result of transforming the value, or a fallback when there is none.
- fromArray
&Array[T] -> Option[T]The first element of an array, as an option.
- holds
&Option[T] -> fn(T) -> Bool -> BoolWhether the value is present and the predicate accepts it.
- isNone
&Option[T] -> BoolWhether a value is absent.
- isSome
&Option[T] -> BoolWhether a value is present.
- keepIf
Option[T] -> fn(T) -> Bool -> Option[T]The value if it is present and the predicate accepts it.
- map
Option[A] -> fn(A) -> B -> Option[B]The value transformed, if there is one.
- map2
Option[A] -> Option[B] -> fn(A, B) -> C -> Option[C]Both values if both are present, combined.
- mapPresent
&Array[A] -> fn(A) -> Option[B] -> Array[B]Every element transformed, keeping only the results that are present.
- okOr
Option[T] -> E -> Result[T, E]A present value, or a declared failure when there is none.
- okOrElse
Option[T] -> fn() -> E -> Result[T, E]The value, or the failure a caller names, without discarding either.
- orElse
Option[T] -> Option[T] -> Option[T]The first value if it is present, otherwise the second.
- present
&Array[Option[T]] -> Array[T]Every present value, with the absent ones dropped.
- toArray
Option[T] -> Array[T]The value as an array of nought or one element, which is how a caller
- unwrapOr
Option[T] -> T -> TThe value, or a fallback when there is none.
- unwrapOrElse
Option[T] -> fn() -> T -> TThe value, or a fallback computed only when there is none.
- when
Bool -> T -> Option[T]A value made present when a condition holds.
- zip
Option[A] -> Option[B] -> Option[(A, B)]Two options paired, present only when both are.
