Documentation
¶
Index ¶
- func Filter[L, R any](e lang.Either[L, R], f func(R) bool) lang.Either[L, R]
- func FlatMap[L, R, R1 any](e lang.Either[L, R], f func(R) lang.Either[L, R1]) lang.Either[L, R1]
- func FlatMapLeft[L, R, L1 any](e lang.Either[L, R], f func(L) lang.Either[L1, R]) lang.Either[L1, R]
- func Flatten[L, R any](e lang.Either[L, lang.Either[L, R]]) lang.Either[L, R]
- func ForEach[L, R any](e lang.Either[L, R], f func(R))
- func FromOption[L, R any](o lang.Option[R], l L) lang.Either[L, R]
- func Left[L, R any](le L) lang.Either[L, R]
- func Map[L, R, R1 any](e lang.Either[L, R], f func(R) R1) lang.Either[L, R1]
- func MapLeft[L, R, L1 any](e lang.Either[L, R], f func(L) L1) lang.Either[L1, R]
- func OrElse[L, R any](e lang.Either[L, R], f func() lang.Either[L, R]) lang.Either[L, R]
- func Right[L, R any](ri R) lang.Either[L, R]
- func Sequence[L, R any](es []lang.Either[L, R]) lang.Either[L, []R]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlatMap ¶
FlatMap is a right biased flat map that applies the given function to the right value of the Either instance.
func FlatMapLeft ¶
func FlatMapLeft[L, R, L1 any](e lang.Either[L, R], f func(L) lang.Either[L1, R]) lang.Either[L1, R]
FlatMapLeft is a left biased flat map that applies the given function to the left value of the Either instance.
func Flatten ¶
Flatten returns the right value of the Either instance if it is right. Otherwise, it returns the right value of the inner Either instance.
func FromOption ¶
FromOption converts an Option instance to an Either instance. If the Option instance is empty, the left value is returned. Otherwise, the right value is returned.
func Map ¶
Map is a right biased map that applies the given function to the right value of the Either instance.
func MapLeft ¶
MapLeft is a left biased map that applies the given function to the left value of the Either instance.
func OrElse ¶
OrElse returns the given Either if it is right. Otherwise, it returns the result of the given function.
Types ¶
This section is empty.