Documentation ¶
Overview ¶
Package option contains Option[A] implementation.
Index ¶
- func Fold[A any, B any](oa Option[A], f func(A) B, g func() B) (b B)
- func ForEach[A any](oa Option[A], f func(A))
- func Get[A any](oa Option[A]) A
- func IsDefined[A any](oa Option[A]) bool
- func IsEmpty[A any](oa Option[A]) bool
- type Option
- func Filter[A any](oa Option[A], predicate func(A) bool) Option[A]
- func FlatMap[A any, B any](oa Option[A], f func(A) Option[B]) Option[B]
- func Flatten[A any](ooa Option[Option[A]]) Option[A]
- func Map[A any, B any](oa Option[A], f func(A) B) Option[B]
- func None[A any]() Option[A]
- func Some[A any](a A) Option[A]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option[A any] struct { ValueOrNil *A }
Option[A] can represent a value or an absent value of type A.
Click to show internal directories.
Click to hide internal directories.