Help us shape the future of Go! Take the 2026 Go Developer Survey

generic

package
v2.3.21 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func After

func After[GA ~func() O.Option[A], A any](timestamp time.Time) func(GA) GA

After creates an operation that passes after the given time.Time

func Alt

func Alt[LAZY ~func() GIOA, GIOA ~func() O.Option[A], A any](second LAZY) func(GIOA) GIOA

func Ap

func Ap[GB ~func() O.Option[B], GAB ~func() O.Option[func(A) B], GA ~func() O.Option[A], A, B any](ma GA) func(GAB) GB

func Chain

func Chain[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](f func(A) GB) func(GA) GB

func ChainFirst

func ChainFirst[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](f func(A) GB) func(GA) GA

ChainFirst runs the monad returned by the function but returns the result of the original monad

func ChainFirstIOK

func ChainFirstIOK[GA ~func() O.Option[A], GIOB ~func() B, A, B any](f func(A) GIOB) func(GA) GA

ChainFirstIOK runs the monad returned by the function but returns the result of the original monad

func ChainIOK

func ChainIOK[GA ~func() O.Option[A], GB ~func() O.Option[B], GR ~func() B, A, B any](f func(A) GR) func(GA) GB

func ChainOptionK

func ChainOptionK[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](f func(A) O.Option[B]) func(GA) GB

func Defer

func Defer[GA ~func() O.Option[A], A any](gen func() GA) GA

Defer creates an IO by creating a brand new IO via a generator function, each time

func Delay

func Delay[GA ~func() O.Option[A], A any](delay time.Duration) func(GA) GA

Delay creates an operation that passes in the value after some delay

func Flatten

func Flatten[GA ~func() O.Option[A], GAA ~func() O.Option[GA], A any](mma GAA) GA

func Fold

func Fold[GA ~func() O.Option[A], GB ~func() B, A, B any](onNone func() GB, onSome func(A) GB) func(GA) GB

Fold convers an IOOption into an IO

func FromEither

func FromEither[GA ~func() O.Option[A], E, A any](e ET.Either[E, A]) GA

func FromIO

func FromIO[GA ~func() O.Option[A], GR ~func() A, A any](mr GR) GA

func FromOption

func FromOption[GA ~func() O.Option[A], A any](o O.Option[A]) GA

func MakeIO

func MakeIO[GA ~func() O.Option[A], A any](f GA) GA

func Map

func Map[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](f func(A) B) func(GA) GB

func Memoize

func Memoize[GA ~func() O.Option[A], A any](ma GA) GA

Memoize computes the value of the provided IO monad lazily but exactly once

func MonadAlt

func MonadAlt[LAZY ~func() GIOA, GIOA ~func() O.Option[A], A any](first GIOA, second LAZY) GIOA

func MonadAp

func MonadAp[GB ~func() O.Option[B], GAB ~func() O.Option[func(A) B], GA ~func() O.Option[A], A, B any](mab GAB, ma GA) GB

func MonadChain

func MonadChain[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](fa GA, f func(A) GB) GB

func MonadChainFirst

func MonadChainFirst[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](ma GA, f func(A) GB) GA

MonadChainFirst runs the monad returned by the function but returns the result of the original monad

func MonadChainFirstIOK

func MonadChainFirstIOK[GA ~func() O.Option[A], GIOB ~func() B, A, B any](first GA, f func(A) GIOB) GA

MonadChainFirstIOK runs the monad returned by the function but returns the result of the original monad

func MonadChainIOK

func MonadChainIOK[GA ~func() O.Option[A], GB ~func() O.Option[B], GR ~func() B, A, B any](ma GA, f func(A) GR) GB

func MonadChainOptionK

func MonadChainOptionK[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](ma GA, f func(A) O.Option[B]) GB

func MonadMap

func MonadMap[GA ~func() O.Option[A], GB ~func() O.Option[B], A, B any](fa GA, f func(A) B) GB

func MonadOf

func MonadOf[GA ~func() O.Option[A], A any](r A) GA

func None

func None[GA ~func() O.Option[A], A any]() GA

func Of

func Of[GA ~func() O.Option[A], A any](r A) GA

func Optionize0

func Optionize0[GA ~func() O.Option[A], A any](f func() (A, bool)) func() GA

func Optionize1

func Optionize1[GA ~func() O.Option[A], T1, A any](f func(t1 T1) (A, bool)) func(T1) GA

func Optionize2

func Optionize2[GA ~func() O.Option[A], T1, T2, A any](f func(t1 T1, t2 T2) (A, bool)) func(T1, T2) GA

func Optionize3

func Optionize3[GA ~func() O.Option[A], T1, T2, T3, A any](f func(t1 T1, t2 T2, t3 T3) (A, bool)) func(T1, T2, T3) GA

func Optionize4

func Optionize4[GA ~func() O.Option[A], T1, T2, T3, T4, A any](f func(t1 T1, t2 T2, t3 T3, t4 T4) (A, bool)) func(T1, T2, T3, T4) GA

func Some

func Some[GA ~func() O.Option[A], A any](r A) GA

Types

This section is empty.

Jump to

Keyboard shortcuts

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