result

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] func() (T, error)

func Bind

func Bind[A, B any, R Result[A]](result R, fn func(A) Result[B]) Result[B]

func Error

func Error[T any](err error) Result[T]

func ErrorString

func ErrorString[T any](text string) Result[T]

func Errorf

func Errorf[T any](format string, a ...any) Result[T]

func Map

func Map[A, B any, R Result[A]](result R, fn func(A) B) Result[B]

func Ok

func Ok[T any](t T) Result[T]

type Result2

type Result2[T, V any] func() (T, V, error)

func Bind2

func Bind2[TA, VA, TB, VB any, R Result2[TA, VA]](result R, fn func(TA, VA) Result2[TB, VB]) Result2[TB, VB]

func Error2

func Error2[T, V any](err error) Result2[T, V]

func Map2

func Map2[TA, VA, TB, VB any, R Result2[TA, VA]](result R, fn func(TA, VA) (TB, VB)) Result2[TB, VB]

func Ok2

func Ok2[T, V any](t T, v V) Result2[T, V]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL