Documentation ¶
Index ¶
- func Chain[A any, B any](fn func(a A) Option[B]) func(Option[A]) Option[B]
- func GetOrElse[T any](onNone fp.Lazy[T]) func(Option[T]) T
- func IsNone[T any](option Option[T]) bool
- func IsSome[T any](option Option[T]) bool
- func Map[T, R any](fn func(value T) R) func(o Option[T]) Option[R]
- func Match[T, R any](onNone fp.Lazy[R], onSome func(value T) R) func(Option[T]) R
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
Execute a function that returns an Option on the Option value if it exists. Otherwise return the empty Option itself
func GetOrElse ¶
Extracts the value out of the Option, if it exists. Otherwise returns the function with a default value
Types ¶
Click to show internal directories.
Click to hide internal directories.