Versions in this module Expand all Collapse all v0 v0.1.0 Jul 27, 2023 Changes in this version + func Compose(fn1 func(T) U, fn2 func(U) V) func(T) V + func Empty() (t T) + func ErrMapUp(fn func(error) E) func(error) error + func Id(t T) T + func If(r Option[T], someFn func(T) Out, noneFn func() Out) Out + func Match(r Result[T], okFn func(T) Out, errFn func(error) Out) Out + func Return(t T) func(In) T + func Return0(t T) func() T + type ApplyToResult struct + func Chain(result Result[T]) ApplyToResult[Out, T] + func (a ApplyToResult[O, T]) AndThen(fn func(T) Result[O]) Result[O] + func (a ApplyToResult[O, T]) Map(fn func(T) O) Result[O] + type ApplyToResult10 struct + func Chain10(result Result[T]) ... + func (a ApplyToResult10[O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, T]) AndThen(fn func(T) Result[O1]) ApplyToResult9[O10, O9, O8, O7, O6, O5, O4, O3, O2, O1] + func (a ApplyToResult10[O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, T]) Map(fn func(T) O1) ApplyToResult9[O10, O9, O8, O7, O6, O5, O4, O3, O2, O1] + type ApplyToResult2 struct + func Chain2(result Result[T]) ApplyToResult2[Out1, Out2, T] + func (a ApplyToResult2[O1, O2, T]) AndThen(fn func(T) Result[O1]) ApplyToResult[O2, O1] + func (a ApplyToResult2[O1, O2, T]) Map(fn func(T) O1) ApplyToResult[O2, O1] + type ApplyToResult3 struct + func Chain3(result Result[T]) ApplyToResult3[Out1, Out2, Out3, T] + func (a ApplyToResult3[O1, O2, O3, T]) AndThen(fn func(T) Result[O1]) ApplyToResult2[O3, O2, O1] + func (a ApplyToResult3[O1, O2, O3, T]) Map(fn func(T) O1) ApplyToResult2[O3, O2, O1] + type ApplyToResult4 struct + func Chain4(result Result[T]) ApplyToResult4[Out1, Out2, Out3, Out4, T] + func (a ApplyToResult4[O1, O2, O3, O4, T]) AndThen(fn func(T) Result[O1]) ApplyToResult3[O4, O3, O2, O1] + func (a ApplyToResult4[O1, O2, O3, O4, T]) Map(fn func(T) O1) ApplyToResult3[O4, O3, O2, O1] + type ApplyToResult5 struct + func Chain5(result Result[T]) ApplyToResult5[Out1, Out2, Out3, Out4, Out5, T] + func (a ApplyToResult5[O1, O2, O3, O4, O5, T]) AndThen(fn func(T) Result[O1]) ApplyToResult4[O5, O4, O3, O2, O1] + func (a ApplyToResult5[O1, O2, O3, O4, O5, T]) Map(fn func(T) O1) ApplyToResult4[O5, O4, O3, O2, O1] + type ApplyToResult6 struct + func Chain6(result Result[T]) ApplyToResult6[Out1, Out2, Out3, Out4, Out5, Out6, T] + func (a ApplyToResult6[O1, O2, O3, O4, O5, O6, T]) AndThen(fn func(T) Result[O1]) ApplyToResult5[O6, O5, O4, O3, O2, O1] + func (a ApplyToResult6[O1, O2, O3, O4, O5, O6, T]) Map(fn func(T) O1) ApplyToResult5[O6, O5, O4, O3, O2, O1] + type ApplyToResult7 struct + func Chain7(result Result[T]) ApplyToResult7[Out1, Out2, Out3, Out4, Out5, Out6, Out7, T] + func (a ApplyToResult7[O1, O2, O3, O4, O5, O6, O7, T]) AndThen(fn func(T) Result[O1]) ApplyToResult6[O7, O6, O5, O4, O3, O2, O1] + func (a ApplyToResult7[O1, O2, O3, O4, O5, O6, O7, T]) Map(fn func(T) O1) ApplyToResult6[O7, O6, O5, O4, O3, O2, O1] + type ApplyToResult8 struct + func Chain8(result Result[T]) ApplyToResult8[Out1, Out2, Out3, Out4, Out5, Out6, Out7, Out8, T] + func (a ApplyToResult8[O1, O2, O3, O4, O5, O6, O7, O8, T]) AndThen(fn func(T) Result[O1]) ApplyToResult7[O8, O7, O6, O5, O4, O3, O2, O1] + func (a ApplyToResult8[O1, O2, O3, O4, O5, O6, O7, O8, T]) Map(fn func(T) O1) ApplyToResult7[O8, O7, O6, O5, O4, O3, O2, O1] + type ApplyToResult9 struct + func Chain9(result Result[T]) ApplyToResult9[Out1, Out2, Out3, Out4, Out5, Out6, Out7, Out8, Out9, T] + func (a ApplyToResult9[O1, O2, O3, O4, O5, O6, O7, O8, O9, T]) AndThen(fn func(T) Result[O1]) ApplyToResult8[O9, O8, O7, O6, O5, O4, O3, O2, O1] + func (a ApplyToResult9[O1, O2, O3, O4, O5, O6, O7, O8, O9, T]) Map(fn func(T) O1) ApplyToResult8[O9, O8, O7, O6, O5, O4, O3, O2, O1] + type Option struct + func Cast(value any) Option[T] + func Maybe(t *T) Option[T] + func None() Option[T] + func Some(value T) Option[T] + func (o Option[T]) AsPtr() *T + func (o Option[T]) Expect(panicMsg string) T + func (o Option[T]) IsNone() bool + func (o Option[T]) IsSome() bool + func (o Option[T]) Some(out *T) bool + func (o Option[T]) Unwrap() T + func (o Option[T]) UnwrapOr(defaultValue T) T + func (o Option[T]) UnwrapOrElse(fn func() T) T + type Result struct + func AndThen(r Result[T], fn func(T) Result[U]) Result[U] + func Err(err error) Result[T] + func Map(r Result[T], fn func(T) U) Result[U] + func Map2(r Result[T], s Result[U], fn func(T, U) V) Result[V] + func Map3(r Result[T], s Result[U], t Result[V], fn func(T, U, V) W) Result[W] + func MapErr(fn func(error) E, r Result[T]) Result[T] + func NewPtrResult(value *T, err error) Result[T] + func NewResult(value T, err error) Result[T] + func NewTupleResult(first T, second U, err error) Result[Tuple[T, U]] + func NewVoidResult(err error) Result[Void] + func Ok(value T) Result[T] + func (r Result[T]) Err() Option[error] + func (r Result[T]) Expect(panicMsg string) T + func (r Result[T]) ExpectErr(panicMsg string) error + func (r Result[T]) IsErr() bool + func (r Result[T]) IsOk() bool + func (r Result[T]) MapError(fn func(e error) error) Result[T] + func (r Result[T]) Ok(out *T) error + func (r Result[T]) Results() (*T, error) + func (r Result[T]) ResultsMappingEmpty() (T, error) + func (r Result[T]) Unwrap() T + func (r Result[T]) UnwrapErr() error + func (r Result[T]) UnwrapErrOr(defaultValue error) error + func (r Result[T]) UnwrapOr(defaultValue T) T + func (r Result[T]) UnwrapOrElse(fn func(error) T) T + func (r Result[T]) Value() Option[T] + func (r Result[T]) WrapErr(format string) Result[T] + type Tuple struct + First T + Second U + func (t Tuple[T, U]) Destructure() (T, U) + type Void struct