Documentation
¶
Index ¶
- func Ap[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](ma GA) func(GAB) GB
- func ApFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](second GB) func(GA) GA
- func ApSecond[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](second GB) func(GA) GB
- func BiMap[GA ~func() ET.Either[E1, A], GB ~func() ET.Either[E2, B], E1, E2, A, B any](f func(E1) E2, g func(A) B) func(GA) GB
- func Bracket[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](acquire GA, use func(A) GB, release func(A, ET.Either[E, B]) GANY) GB
- func Chain[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](f func(A) GB) func(GA) GB
- func ChainEitherK[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](f func(A) ET.Either[E, B]) func(GA) GB
- func ChainFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](f func(A) GB) func(GA) GA
- func ChainFirstIOK[GA ~func() ET.Either[E, A], GIOB ~func() B, E, A, B any](f func(A) GIOB) func(GA) GA
- func ChainIOK[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GR ~func() B, ...](f func(A) GR) func(GA) GB
- func ChainOptionK[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](onNone func() E) func(func(A) O.Option[B]) func(GA) GB
- func ChainTo[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](fb GB) func(GA) GB
- func Command[GA ~func() ET.Either[error, exec.CommandOutput]](name string, args []string, in []byte) GA
- func Defer[GEA ~func() ET.Either[E, A], E, A any](gen func() GEA) GEA
- func Delay[GA ~func() ET.Either[E, A], E, A any](delay time.Duration) func(GA) GA
- func Eitherize0[GEA ~func() ET.Either[error, A], GA ~func() (A, error), A any](f GA) func() GEA
- func Eitherize1[GEA ~func() ET.Either[error, A], GA ~func(t1 T1) (A, error), T1, A any](f GA) func(T1) GEA
- func Eitherize2[GEA ~func() ET.Either[error, A], GA ~func(t1 T1, t2 T2) (A, error), ...](f GA) func(T1, T2) GEA
- func Eitherize3[GEA ~func() ET.Either[error, A], GA ~func(t1 T1, t2 T2, t3 T3) (A, error), ...](f GA) func(T1, T2, T3) GEA
- func Eitherize4[GEA ~func() ET.Either[error, A], ...](f GA) func(T1, T2, T3, T4) GEA
- func Eq[GA ~func() ET.Either[E, A], E, A any](eq EQ.Eq[ET.Either[E, A]]) EQ.Eq[GA]
- func Flatten[GA ~func() ET.Either[E, A], GAA ~func() ET.Either[E, GA], E, A any](mma GAA) GA
- func Fold[GA ~func() ET.Either[E, A], GB ~func() B, E, A, B any](onLeft func(E) GB, onRight func(A) GB) func(GA) GB
- func FromEither[GA ~func() ET.Either[E, A], E, A any](e ET.Either[E, A]) GA
- func FromIO[GA ~func() ET.Either[E, A], GR ~func() A, E, A any](mr GR) GA
- func FromImpure[GA ~func() ET.Either[E, any], IMP ~func(), E any](f IMP) GA
- func FromOption[GA ~func() ET.Either[E, A], E, A any](onNone func() E) func(o O.Option[A]) GA
- func FromStrictEquals[GA ~func() ET.Either[E, A], E, A comparable]() EQ.Eq[GA]
- func GetOrElse[GA ~func() ET.Either[E, A], GB ~func() A, E, A any](onLeft func(E) GB) func(GA) GB
- func Left[GA ~func() ET.Either[E, A], E, A any](l E) GA
- func LeftIO[GA ~func() ET.Either[E, A], GE ~func() E, E, A any](ml GE) GA
- func MakeIO[GA ~func() ET.Either[E, A], E, A any](f GA) GA
- func Map[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](f func(A) B) func(GA) GB
- func MapLeft[GA1 ~func() ET.Either[E1, A], GA2 ~func() ET.Either[E2, A], E1, E2, A any](f func(E1) E2) func(GA1) GA2
- func MapTo[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](b B) func(GA) GB
- func Memoize[GA ~func() ET.Either[E, A], E, A any](ma GA) GA
- func MonadAp[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](mab GAB, ma GA) GB
- func MonadApFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](first GA, second GB) GA
- func MonadApSecond[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](first GA, second GB) GB
- func MonadBiMap[GA ~func() ET.Either[E1, A], GB ~func() ET.Either[E2, B], E1, E2, A, B any](fa GA, f func(E1) E2, g func(A) B) GB
- func MonadChain[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](fa GA, f func(A) GB) GB
- func MonadChainEitherK[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](ma GA, f func(A) ET.Either[E, B]) GB
- func MonadChainFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](ma GA, f func(A) GB) GA
- func MonadChainFirstIOK[GA ~func() ET.Either[E, A], GIOB ~func() B, E, A, B any](first GA, f func(A) GIOB) GA
- func MonadChainIOK[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GR ~func() B, ...](ma GA, f func(A) GR) GB
- func MonadChainTo[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](fa GA, fb GB) GB
- func MonadFold[GA ~func() ET.Either[E, A], GB ~func() B, E, A, B any](ma GA, onLeft func(E) GB, onRight func(A) GB) GB
- func MonadMap[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](fa GA, f func(A) B) GB
- func MonadMapLeft[GA1 ~func() ET.Either[E1, A], GA2 ~func() ET.Either[E2, A], E1, E2, A any](fa GA1, f func(E1) E2) GA2
- func MonadMapTo[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, A, B any](fa GA, b B) GB
- func MonadOf[GA ~func() ET.Either[E, A], E, A any](r A) GA
- func MonadTraverseArray[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~[]A, BBS ~[]B, ...](tas AAS, f func(A) GB) GBS
- func MonadTraverseRecord[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~map[K]A, ...](tas AAS, f func(A) GB) GBS
- func Of[GA ~func() ET.Either[E, A], E, A any](r A) GA
- func Retrying[GA ~func() ET.Either[E, A], E, A any](policy R.RetryPolicy, action func(R.RetryStatus) GA, ...) GA
- func Right[GA ~func() ET.Either[E, A], E, A any](r A) GA
- func RightIO[GA ~func() ET.Either[E, A], GR ~func() A, E, A any](mr GR) GA
- func SequenceArray[GA ~func() ET.Either[E, A], GAS ~func() ET.Either[E, AAS], AAS ~[]A, ...](tas GAAS) GAS
- func SequenceRecord[GA ~func() ET.Either[E, A], GAS ~func() ET.Either[E, AAS], AAS ~map[K]A, ...](tas GAAS) GAS
- func SequenceT1[GA ~func() ET.Either[E, A], GTA ~func() ET.Either[E, T.Tuple1[A]], E, A any](a GA) GTA
- func SequenceT2[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](a GA, b GB) GTAB
- func SequenceT3[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](a GA, b GB, c GC) GTABC
- func SequenceT4[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], ...](a GA, b GB, c GC, d GD) GTABCD
- func Swap[GEA ~func() ET.Either[E, A], GAE ~func() ET.Either[A, E], E, A any](val GEA) GAE
- func TraverseArray[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~[]A, BBS ~[]B, ...](f func(A) GB) func(AAS) GBS
- func TraverseRecord[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~map[K]A, ...](f func(A) GB) func(AAS) GBS
- func TryCatch[GA ~func() ET.Either[E, A], E, A any](f func() (A, error), onThrow func(error) E) GA
- func TryCatchError[GA ~func() ET.Either[error, A], A any](f func() (A, error)) GA
- func Uneitherize0[GEA ~func() ET.Either[error, A], GTA ~func() GEA, A any](f GTA) func() (A, error)
- func Uneitherize1[GEA ~func() ET.Either[error, A], GTA ~func(t1 T1) GEA, T1, A any](f GTA) func(T1) (A, error)
- func Uneitherize2[GEA ~func() ET.Either[error, A], GTA ~func(t1 T1, t2 T2) GEA, T1, T2, A any](f GTA) func(T1, T2) (A, error)
- func Uneitherize3[GEA ~func() ET.Either[error, A], GTA ~func(t1 T1, t2 T2, t3 T3) GEA, ...](f GTA) func(T1, T2, T3) (A, error)
- func Uneitherize4[GEA ~func() ET.Either[error, A], GTA ~func(t1 T1, t2 T2, t3 T3, t4 T4) GEA, ...](f GTA) func(T1, T2, T3, T4) (A, error)
- func WithResource[GA ~func() ET.Either[E, A], GR ~func() ET.Either[E, R], ...](onCreate GR, onRelease func(R) GANY) func(func(R) GA) GA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApFirst ¶
func ApFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GBA ~func() ET.Either[E, func(B) A], E, A, B any](second GB) func(GA) GA
ApFirst combines two effectful actions, keeping only the result of the first.
func ApSecond ¶
func ApSecond[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GBB ~func() ET.Either[E, func(B) B], E, A, B any](second GB) func(GA) GB
ApSecond combines two effectful actions, keeping only the result of the second.
func BiMap ¶
func BiMap[GA ~func() ET.Either[E1, A], GB ~func() ET.Either[E2, B], E1, E2, A, B any](f func(E1) E2, g func(A) B) func(GA) GB
BiMap maps a pair of functions over the two type arguments of the bifunctor.
func Bracket ¶
func Bracket[ GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GANY ~func() ET.Either[E, ANY], E, A, B, ANY any]( acquire GA, use func(A) GB, release func(A, ET.Either[E, B]) GANY, ) GB
Bracket makes sure that a resource is cleaned up in the event of an error. The release action is called regardless of whether the body action returns and error or not.
func ChainEitherK ¶
func ChainFirst ¶
func ChainFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, 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() ET.Either[E, A], GIOB ~func() B, E, 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 ChainOptionK ¶
func Command ¶
func Command[GA ~func() ET.Either[error, exec.CommandOutput]](name string, args []string, in []byte) GA
Command executes a command
func Eitherize0 ¶
func Eitherize1 ¶
func Eitherize2 ¶
func Eitherize3 ¶
func Eitherize4 ¶
func Fold ¶
func Fold[GA ~func() ET.Either[E, A], GB ~func() B, E, A, B any](onLeft func(E) GB, onRight func(A) GB) func(GA) GB
Fold convers an IOEither into an IO
func FromImpure ¶
FromImpure converts a side effect without a return value into a side effect that returns any
func FromOption ¶
func FromStrictEquals ¶
func FromStrictEquals[GA ~func() ET.Either[E, A], E, A comparable]() EQ.Eq[GA]
FromStrictEquals constructs an `Eq` from the canonical comparison function
func MonadApFirst ¶
func MonadApFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GBA ~func() ET.Either[E, func(B) A], E, A, B any](first GA, second GB) GA
MonadApFirst combines two effectful actions, keeping only the result of the first.
func MonadApSecond ¶
func MonadApSecond[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], GBB ~func() ET.Either[E, func(B) B], E, A, B any](first GA, second GB) GB
MonadApSecond combines two effectful actions, keeping only the result of the second.
func MonadBiMap ¶
func MonadChain ¶
func MonadChainEitherK ¶
func MonadChainFirst ¶
func MonadChainFirst[GA ~func() ET.Either[E, A], GB ~func() ET.Either[E, B], E, 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() ET.Either[E, A], GIOB ~func() B, E, 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 MonadChainTo ¶
func MonadMapLeft ¶
func MonadMapTo ¶
func MonadTraverseArray ¶
func MonadTraverseArray[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~[]A, BBS ~[]B, E, A, B any](tas AAS, f func(A) GB) GBS
MonadTraverseArray transforms an array
func MonadTraverseRecord ¶
func MonadTraverseRecord[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~map[K]A, BBS ~map[K]B, K comparable, E, A, B any](tas AAS, f func(A) GB) GBS
MonadTraverseRecord transforms an array
func Retrying ¶
func Retrying[GA ~func() ET.Either[E, A], E, A any]( policy R.RetryPolicy, action func(R.RetryStatus) GA, check func(ET.Either[E, A]) bool, ) GA
Retry combinator for actions that don't raise exceptions, but signal in their type the outcome has failed. Examples are the `Option`, `Either` and `EitherT` monads.
policy - refers to the retry policy action - converts a status into an operation to be executed check - checks if the result of the action needs to be retried
func SequenceArray ¶
func SequenceArray[GA ~func() ET.Either[E, A], GAS ~func() ET.Either[E, AAS], AAS ~[]A, GAAS ~[]GA, E, A any](tas GAAS) GAS
SequenceArray converts a homogeneous sequence of either into an either of sequence
func SequenceRecord ¶
func SequenceRecord[GA ~func() ET.Either[E, A], GAS ~func() ET.Either[E, AAS], AAS ~map[K]A, GAAS ~map[K]GA, K comparable, E, A any](tas GAAS) GAS
SequenceRecord converts a homogeneous sequence of either into an either of sequence
func SequenceT1 ¶
func SequenceT2 ¶
func SequenceT3 ¶
func SequenceT4 ¶
func TraverseArray ¶
func TraverseArray[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~[]A, BBS ~[]B, E, A, B any](f func(A) GB) func(AAS) GBS
TraverseArray transforms an array
func TraverseRecord ¶
func TraverseRecord[GB ~func() ET.Either[E, B], GBS ~func() ET.Either[E, BBS], AAS ~map[K]A, BBS ~map[K]B, K comparable, E, A, B any](f func(A) GB) func(AAS) GBS
TraverseRecord transforms an array
func TryCatchError ¶
func Uneitherize0 ¶
func Uneitherize1 ¶
func Uneitherize2 ¶
func Uneitherize3 ¶
func Uneitherize4 ¶
func WithResource ¶
func WithResource[ GA ~func() ET.Either[E, A], GR ~func() ET.Either[E, R], GANY ~func() ET.Either[E, ANY], E, R, A, ANY any](onCreate GR, onRelease func(R) GANY) func(func(R) GA) GA
WithResource constructs a function that creates a resource, then operates on it and then releases the resource
Types ¶
This section is empty.