package ioeither
import "github.com/IBM/fp-go/ioeither"
Index ¶
- func After[E, A any](timestamp time.Time) func(IOEither[E, A]) IOEither[E, A]
- func Alt[E, A any](second L.Lazy[IOEither[E, A]]) func(IOEither[E, A]) IOEither[E, A]
- func AltSemigroup[E, A any]() S.Semigroup[IOEither[E, A]]
- func Ap[B, E, A any](ma IOEither[E, A]) func(IOEither[E, func(A) B]) IOEither[E, B]
- func ApFirst[A, E, B any](second IOEither[E, B]) func(IOEither[E, A]) IOEither[E, A]
- func ApPar[B, E, A any](ma IOEither[E, A]) func(IOEither[E, func(A) B]) IOEither[E, B]
- func ApS[E, S1, S2, T any]( setter func(T) func(S1) S2, fa IOEither[E, T], ) func(IOEither[E, S1]) IOEither[E, S2]
- func ApSecond[A, E, B any](second IOEither[E, B]) func(IOEither[E, A]) IOEither[E, B]
- func ApSeq[B, E, A any](ma IOEither[E, A]) func(IOEither[E, func(A) B]) IOEither[E, B]
- func ApplicativeMonoid[E, A any]( m M.Monoid[A], ) M.Monoid[IOEither[E, A]]
- func ApplicativeMonoidPar[E, A any]( m M.Monoid[A], ) M.Monoid[IOEither[E, A]]
- func ApplicativeMonoidSeq[E, A any]( m M.Monoid[A], ) M.Monoid[IOEither[E, A]]
- func BiMap[E1, E2, A, B any](f func(E1) E2, g func(A) B) func(IOEither[E1, A]) IOEither[E2, B]
- func Bind[E, S1, S2, T any]( setter func(T) func(S1) S2, f func(S1) IOEither[E, T], ) func(IOEither[E, S1]) IOEither[E, S2]
- func BindTo[E, S1, T any]( setter func(T) S1, ) func(IOEither[E, T]) IOEither[E, S1]
- func Chain[E, A, B any](f func(A) IOEither[E, B]) func(IOEither[E, A]) IOEither[E, B]
- func ChainEitherK[E, A, B any](f func(A) ET.Either[E, B]) func(IOEither[E, A]) IOEither[E, B]
- func ChainFirst[E, A, B any](f func(A) IOEither[E, B]) func(IOEither[E, A]) IOEither[E, A]
- func ChainFirstEitherK[A, E, B any](f func(A) ET.Either[E, B]) func(ma IOEither[E, A]) IOEither[E, A]
- func ChainFirstIOK[E, A, B any](f func(A) I.IO[B]) func(IOEither[E, A]) IOEither[E, A]
- func ChainIOK[E, A, B any](f func(A) I.IO[B]) func(IOEither[E, A]) IOEither[E, B]
- func ChainLazyK[E, A, B any](f func(A) L.Lazy[B]) func(IOEither[E, A]) IOEither[E, B]
- func ChainOptionK[A, B, E any](onNone func() E) func(func(A) O.Option[B]) func(IOEither[E, A]) IOEither[E, B]
- func ChainTo[A, E, B any](fb IOEither[E, B]) func(IOEither[E, A]) IOEither[E, B]
- func Delay[E, A any](delay time.Duration) func(IOEither[E, A]) IOEither[E, A]
- func Eitherize0[F ~func() (R, error), R any](f F) func() IOEither[error, R]
- func Eitherize1[F ~func(T1) (R, error), T1, R any](f F) func(T1) IOEither[error, R]
- func Eitherize10[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) (R, error), T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) IOEither[error, R]
- func Eitherize2[F ~func(T1, T2) (R, error), T1, T2, R any](f F) func(T1, T2) IOEither[error, R]
- func Eitherize3[F ~func(T1, T2, T3) (R, error), T1, T2, T3, R any](f F) func(T1, T2, T3) IOEither[error, R]
- func Eitherize4[F ~func(T1, T2, T3, T4) (R, error), T1, T2, T3, T4, R any](f F) func(T1, T2, T3, T4) IOEither[error, R]
- func Eitherize5[F ~func(T1, T2, T3, T4, T5) (R, error), T1, T2, T3, T4, T5, R any](f F) func(T1, T2, T3, T4, T5) IOEither[error, R]
- func Eitherize6[F ~func(T1, T2, T3, T4, T5, T6) (R, error), T1, T2, T3, T4, T5, T6, R any](f F) func(T1, T2, T3, T4, T5, T6) IOEither[error, R]
- func Eitherize7[F ~func(T1, T2, T3, T4, T5, T6, T7) (R, error), T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T1, T2, T3, T4, T5, T6, T7) IOEither[error, R]
- func Eitherize8[F ~func(T1, T2, T3, T4, T5, T6, T7, T8) (R, error), T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8) IOEither[error, R]
- func Eitherize9[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error), T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9) IOEither[error, R]
- func Eq[E, A any](eq EQ.Eq[ET.Either[E, A]]) EQ.Eq[IOEither[E, A]]
- func Flap[E, B, A any](a A) func(IOEither[E, func(A) B]) IOEither[E, B]
- func Fold[E, A, B any](onLeft func(E) I.IO[B], onRight func(A) I.IO[B]) func(IOEither[E, A]) I.IO[B]
- func FromIOOption[A, E any](onNone func() E) func(o IOO.IOOption[A]) IOEither[E, A]
- func FromOption[A, E any](onNone func() E) func(o O.Option[A]) IOEither[E, A]
- func FromStrictEquals[E, A comparable]() EQ.Eq[IOEither[E, A]]
- func Functor[E, A, B any]() functor.Functor[A, B, IOEither[E, A], IOEither[E, B]]
- func GetOrElse[E, A any](onLeft func(E) I.IO[A]) func(IOEither[E, A]) I.IO[A]
- func Let[E, S1, S2, T any]( setter func(T) func(S1) S2, f func(S1) T, ) func(IOEither[E, S1]) IOEither[E, S2]
- func LetTo[E, S1, S2, T any]( setter func(T) func(S1) S2, b T, ) func(IOEither[E, S1]) IOEither[E, S2]
- func LogJSON[A any](prefix string) func(A) IOEither[error, any]
- func LogJson[A any](prefix string) func(A) IOEither[error, any]
- func Map[E, A, B any](f func(A) B) func(IOEither[E, A]) IOEither[E, B]
- func MapLeft[A, E1, E2 any](f func(E1) E2) func(IOEither[E1, A]) IOEither[E2, A]
- func MapTo[E, A, B any](b B) func(IOEither[E, A]) IOEither[E, B]
- func Monad[E, A, B any]() monad.Monad[A, B, IOEither[E, A], IOEither[E, B], IOEither[E, func(A) B]]
- func Pointed[E, A any]() pointed.Pointed[A, IOEither[E, A]]
- func ToIOOption[E, A any](ioe IOEither[E, A]) IOO.IOOption[A]
- func TraverseArray[E, A, B any](f func(A) IOEither[E, B]) func([]A) IOEither[E, []B]
- func TraverseArrayPar[E, A, B any](f func(A) IOEither[E, B]) func([]A) IOEither[E, []B]
- func TraverseArraySeq[E, A, B any](f func(A) IOEither[E, B]) func([]A) IOEither[E, []B]
- func TraverseArrayWithIndex[E, A, B any](f func(int, A) IOEither[E, B]) func([]A) IOEither[E, []B]
- func TraverseArrayWithIndexPar[E, A, B any](f func(int, A) IOEither[E, B]) func([]A) IOEither[E, []B]
- func TraverseArrayWithIndexSeq[E, A, B any](f func(int, A) IOEither[E, B]) func([]A) IOEither[E, []B]
- func TraverseRecord[K comparable, E, A, B any](f func(A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
- func TraverseRecordPar[K comparable, E, A, B any](f func(A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
- func TraverseRecordSeq[K comparable, E, A, B any](f func(A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
- func TraverseRecordWithIndex[K comparable, E, A, B any](f func(K, A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
- func TraverseRecordWithIndexPar[K comparable, E, A, B any](f func(K, A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
- func TraverseRecordWithIndexSeq[K comparable, E, A, B any](f func(K, A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
- func TraverseTuple1[F1 ~func(A1) IOEither[E, T1], E, A1, T1 any](f1 F1) func(T.Tuple1[A1]) IOEither[E, T.Tuple1[T1]]
- func TraverseTuple10[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], F10 ~func(A10) IOEither[E, T10], E, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(T.Tuple10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
- func TraverseTuple2[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], E, A1, A2, T1, T2 any](f1 F1, f2 F2) func(T.Tuple2[A1, A2]) IOEither[E, T.Tuple2[T1, T2]]
- func TraverseTuple3[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], E, A1, A2, A3, T1, T2, T3 any](f1 F1, f2 F2, f3 F3) func(T.Tuple3[A1, A2, A3]) IOEither[E, T.Tuple3[T1, T2, T3]]
- func TraverseTuple4[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], E, A1, A2, A3, A4, T1, T2, T3, T4 any](f1 F1, f2 F2, f3 F3, f4 F4) func(T.Tuple4[A1, A2, A3, A4]) IOEither[E, T.Tuple4[T1, T2, T3, T4]]
- func TraverseTuple5[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], E, A1, A2, A3, A4, A5, T1, T2, T3, T4, T5 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(T.Tuple5[A1, A2, A3, A4, A5]) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]
- func TraverseTuple6[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], E, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(T.Tuple6[A1, A2, A3, A4, A5, A6]) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]
- func TraverseTuple7[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], E, A1, A2, A3, A4, A5, A6, A7, T1, T2, T3, T4, T5, T6, T7 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(T.Tuple7[A1, A2, A3, A4, A5, A6, A7]) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
- func TraverseTuple8[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], E, A1, A2, A3, A4, A5, A6, A7, A8, T1, T2, T3, T4, T5, T6, T7, T8 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(T.Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
- func TraverseTuple9[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], E, A1, A2, A3, A4, A5, A6, A7, A8, A9, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(T.Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
- func Uneitherize0[F ~func() IOEither[error, R], R any](f F) func() (R, error)
- func Uneitherize1[F ~func(T1) IOEither[error, R], T1, R any](f F) func(T1) (R, error)
- func Uneitherize10[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) (R, error)
- func Uneitherize2[F ~func(T1, T2) IOEither[error, R], T1, T2, R any](f F) func(T1, T2) (R, error)
- func Uneitherize3[F ~func(T1, T2, T3) IOEither[error, R], T1, T2, T3, R any](f F) func(T1, T2, T3) (R, error)
- func Uneitherize4[F ~func(T1, T2, T3, T4) IOEither[error, R], T1, T2, T3, T4, R any](f F) func(T1, T2, T3, T4) (R, error)
- func Uneitherize5[F ~func(T1, T2, T3, T4, T5) IOEither[error, R], T1, T2, T3, T4, T5, R any](f F) func(T1, T2, T3, T4, T5) (R, error)
- func Uneitherize6[F ~func(T1, T2, T3, T4, T5, T6) IOEither[error, R], T1, T2, T3, T4, T5, T6, R any](f F) func(T1, T2, T3, T4, T5, T6) (R, error)
- func Uneitherize7[F ~func(T1, T2, T3, T4, T5, T6, T7) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T1, T2, T3, T4, T5, T6, T7) (R, error)
- func Uneitherize8[F ~func(T1, T2, T3, T4, T5, T6, T7, T8) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8) (R, error)
- func Uneitherize9[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error)
- func WithLock[E, A any](lock IO.IO[context.CancelFunc]) func(fa IOEither[E, A]) IOEither[E, A]
- func WithResource[A, E, R, ANY any](onCreate IOEither[E, R], onRelease func(R) IOEither[E, ANY]) func(func(R) IOEither[E, A]) IOEither[E, A]
- type IOEither
- func Bracket[E, A, B, ANY any]( acquire IOEither[E, A], use func(A) IOEither[E, B], release func(A, ET.Either[E, B]) IOEither[E, ANY], ) IOEither[E, B]
- func Defer[E, A any](gen L.Lazy[IOEither[E, A]]) IOEither[E, A]
- func Do[E, S any]( empty S, ) IOEither[E, S]
- func Flatten[E, A any](mma IOEither[E, IOEither[E, A]]) IOEither[E, A]
- func FromEither[E, A any](e ET.Either[E, A]) IOEither[E, A]
- func FromIO[E, A any](mr I.IO[A]) IOEither[E, A]
- func FromImpure[E any](f func()) IOEither[E, any]
- func FromLazy[E, A any](mr L.Lazy[A]) IOEither[E, A]
- func Left[A, E any](l E) IOEither[E, A]
- func LeftIO[A, E any](ml I.IO[E]) IOEither[E, A]
- func MakeIO[E, A any](f IOEither[E, A]) IOEither[E, A]
- func Memoize[E, A any](ma IOEither[E, A]) IOEither[E, A]
- func MonadAlt[E, A any](first IOEither[E, A], second L.Lazy[IOEither[E, A]]) IOEither[E, A]
- func MonadAp[B, E, A any](mab IOEither[E, func(A) B], ma IOEither[E, A]) IOEither[E, B]
- func MonadApFirst[A, E, B any](first IOEither[E, A], second IOEither[E, B]) IOEither[E, A]
- func MonadApPar[B, E, A any](mab IOEither[E, func(A) B], ma IOEither[E, A]) IOEither[E, B]
- func MonadApSecond[A, E, B any](first IOEither[E, A], second IOEither[E, B]) IOEither[E, B]
- func MonadApSeq[B, E, A any](mab IOEither[E, func(A) B], ma IOEither[E, A]) IOEither[E, B]
- func MonadBiMap[E1, E2, A, B any](fa IOEither[E1, A], f func(E1) E2, g func(A) B) IOEither[E2, B]
- func MonadChain[E, A, B any](fa IOEither[E, A], f func(A) IOEither[E, B]) IOEither[E, B]
- func MonadChainEitherK[E, A, B any](ma IOEither[E, A], f func(A) ET.Either[E, B]) IOEither[E, B]
- func MonadChainFirst[E, A, B any](ma IOEither[E, A], f func(A) IOEither[E, B]) IOEither[E, A]
- func MonadChainFirstEitherK[A, E, B any](ma IOEither[E, A], f func(A) ET.Either[E, B]) IOEither[E, A]
- func MonadChainFirstIOK[E, A, B any](ma IOEither[E, A], f func(A) I.IO[B]) IOEither[E, A]
- func MonadChainIOK[E, A, B any](ma IOEither[E, A], f func(A) I.IO[B]) IOEither[E, B]
- func MonadChainTo[A, E, B any](fa IOEither[E, A], fb IOEither[E, B]) IOEither[E, B]
- func MonadFlap[E, B, A any](fab IOEither[E, func(A) B], a A) IOEither[E, B]
- func MonadMap[E, A, B any](fa IOEither[E, A], f func(A) B) IOEither[E, B]
- func MonadMapLeft[E1, E2, A any](fa IOEither[E1, A], f func(E1) E2) IOEither[E2, A]
- func MonadMapTo[E, A, B any](fa IOEither[E, A], b B) IOEither[E, B]
- func MonadOf[E, A any](r A) IOEither[E, A]
- func Of[E, A any](r A) IOEither[E, A]
- func Retrying[E, A any]( policy R.RetryPolicy, action func(R.RetryStatus) IOEither[E, A], check func(ET.Either[E, A]) bool, ) IOEither[E, A]
- func Right[E, A any](r A) IOEither[E, A]
- func RightIO[E, A any](mr I.IO[A]) IOEither[E, A]
- func SequenceArray[E, A any](ma []IOEither[E, A]) IOEither[E, []A]
- func SequenceArrayPar[E, A any](ma []IOEither[E, A]) IOEither[E, []A]
- func SequenceArraySeq[E, A any](ma []IOEither[E, A]) IOEither[E, []A]
- func SequenceRecord[K comparable, E, A any](ma map[K]IOEither[E, A]) IOEither[E, map[K]A]
- func SequenceRecordPar[K comparable, E, A any](ma map[K]IOEither[E, A]) IOEither[E, map[K]A]
- func SequenceRecordSeq[K comparable, E, A any](ma map[K]IOEither[E, A]) IOEither[E, map[K]A]
- func SequenceT1[E, T1 any]( t1 IOEither[E, T1], ) IOEither[E, T.Tuple1[T1]]
- func SequenceT10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], t8 IOEither[E, T8], t9 IOEither[E, T9], t10 IOEither[E, T10], ) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
- func SequenceT2[E, T1, T2 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], ) IOEither[E, T.Tuple2[T1, T2]]
- func SequenceT3[E, T1, T2, T3 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], ) IOEither[E, T.Tuple3[T1, T2, T3]]
- func SequenceT4[E, T1, T2, T3, T4 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], ) IOEither[E, T.Tuple4[T1, T2, T3, T4]]
- func SequenceT5[E, T1, T2, T3, T4, T5 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], ) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]
- func SequenceT6[E, T1, T2, T3, T4, T5, T6 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], ) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]
- func SequenceT7[E, T1, T2, T3, T4, T5, T6, T7 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], ) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
- func SequenceT8[E, T1, T2, T3, T4, T5, T6, T7, T8 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], t8 IOEither[E, T8], ) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
- func SequenceT9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], t8 IOEither[E, T8], t9 IOEither[E, T9], ) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
- func SequenceTuple1[E, T1 any](t T.Tuple1[IOEither[E, T1]]) IOEither[E, T.Tuple1[T1]]
- func SequenceTuple10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t T.Tuple10[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9], IOEither[E, T10]]) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
- func SequenceTuple2[E, T1, T2 any](t T.Tuple2[IOEither[E, T1], IOEither[E, T2]]) IOEither[E, T.Tuple2[T1, T2]]
- func SequenceTuple3[E, T1, T2, T3 any](t T.Tuple3[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3]]) IOEither[E, T.Tuple3[T1, T2, T3]]
- func SequenceTuple4[E, T1, T2, T3, T4 any](t T.Tuple4[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4]]) IOEither[E, T.Tuple4[T1, T2, T3, T4]]
- func SequenceTuple5[E, T1, T2, T3, T4, T5 any](t T.Tuple5[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5]]) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]
- func SequenceTuple6[E, T1, T2, T3, T4, T5, T6 any](t T.Tuple6[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6]]) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]
- func SequenceTuple7[E, T1, T2, T3, T4, T5, T6, T7 any](t T.Tuple7[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7]]) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
- func SequenceTuple8[E, T1, T2, T3, T4, T5, T6, T7, T8 any](t T.Tuple8[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8]]) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
- func SequenceTuple9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t T.Tuple9[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9]]) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
- func Swap[E, A any](val IOEither[E, A]) IOEither[A, E]
- func TryCatch[E, A any](f func() (A, error), onThrow func(error) E) IOEither[E, A]
- func TryCatchError[A any](f func() (A, error)) IOEither[error, A]
Examples ¶
Functions ¶
func After ¶
After creates an operation that passes after the given time.Time
func Alt ¶
Alt identifies an associative operation on a type constructor
func AltSemigroup ¶
AltSemigroup is a [Semigroup] that tries the first item and then the second one using an alternative
func Ap ¶
Ap is an alias of ApPar
func ApFirst ¶
ApFirst combines two effectful actions, keeping only the result of the first.
func ApPar ¶
ApPar applies function and value in parallel
func ApS ¶
func ApS[E, S1, S2, T any]( setter func(T) func(S1) S2, fa IOEither[E, T], ) func(IOEither[E, S1]) IOEither[E, S2]
ApS attaches a value to a context [S1] to produce a context [S2] by considering the context and the value concurrently
func ApSecond ¶
ApSecond combines two effectful actions, keeping only the result of the second.
func ApSeq ¶
ApSeq applies function and value sequentially
func ApplicativeMonoid ¶
ApplicativeMonoid returns a [Monoid] that concatenates IOEither instances via their applicative
func ApplicativeMonoidPar ¶
ApplicativeMonoid returns a [Monoid] that concatenates IOEither instances via their applicative
func ApplicativeMonoidSeq ¶
ApplicativeMonoid returns a [Monoid] that concatenates IOEither instances via their applicative
func BiMap ¶
BiMap maps a pair of functions over the two type arguments of the bifunctor.
func Bind ¶
func Bind[E, S1, S2, T any]( setter func(T) func(S1) S2, f func(S1) IOEither[E, T], ) func(IOEither[E, S1]) IOEither[E, S2]
Bind attaches the result of a computation to a context [S1] to produce a context [S2]
func BindTo ¶
BindTo initializes a new state [S1] from a value [T]
func Chain ¶
func ChainEitherK ¶
func ChainFirst ¶
ChainFirst runs the IOEither monad returned by the function but returns the result of the original monad
func ChainFirstEitherK ¶
func ChainFirstEitherK[A, E, B any](f func(A) ET.Either[E, B]) func(ma IOEither[E, A]) IOEither[E, A]
func ChainFirstIOK ¶
ChainFirstIOK runs the [IO] monad returned by the function but returns the result of the original monad
func ChainIOK ¶
func ChainLazyK ¶
func ChainOptionK ¶
func ChainOptionK[A, B, E any](onNone func() E) func(func(A) O.Option[B]) func(IOEither[E, A]) IOEither[E, B]
func ChainTo ¶
ChainTo composes to the second IOEither monad ignoring the return value of the first
func Delay ¶
Delay creates an operation that passes in the value after some delay
func Eitherize0 ¶
Eitherize0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [IOEither[error, R]]
func Eitherize1 ¶
Eitherize1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [IOEither[error, R]]
func Eitherize10 ¶
func Eitherize10[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) (R, error), T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) IOEither[error, R]
Eitherize10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [IOEither[error, R]]
func Eitherize2 ¶
Eitherize2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [IOEither[error, R]]
func Eitherize3 ¶
func Eitherize3[F ~func(T1, T2, T3) (R, error), T1, T2, T3, R any](f F) func(T1, T2, T3) IOEither[error, R]
Eitherize3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [IOEither[error, R]]
func Eitherize4 ¶
func Eitherize4[F ~func(T1, T2, T3, T4) (R, error), T1, T2, T3, T4, R any](f F) func(T1, T2, T3, T4) IOEither[error, R]
Eitherize4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [IOEither[error, R]]
func Eitherize5 ¶
func Eitherize5[F ~func(T1, T2, T3, T4, T5) (R, error), T1, T2, T3, T4, T5, R any](f F) func(T1, T2, T3, T4, T5) IOEither[error, R]
Eitherize5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [IOEither[error, R]]
func Eitherize6 ¶
func Eitherize6[F ~func(T1, T2, T3, T4, T5, T6) (R, error), T1, T2, T3, T4, T5, T6, R any](f F) func(T1, T2, T3, T4, T5, T6) IOEither[error, R]
Eitherize6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [IOEither[error, R]]
func Eitherize7 ¶
func Eitherize7[F ~func(T1, T2, T3, T4, T5, T6, T7) (R, error), T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T1, T2, T3, T4, T5, T6, T7) IOEither[error, R]
Eitherize7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [IOEither[error, R]]
func Eitherize8 ¶
func Eitherize8[F ~func(T1, T2, T3, T4, T5, T6, T7, T8) (R, error), T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8) IOEither[error, R]
Eitherize8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [IOEither[error, R]]
func Eitherize9 ¶
func Eitherize9[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error), T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9) IOEither[error, R]
Eitherize9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [IOEither[error, R]]
func Eq ¶
Eq implements the equals predicate for values contained in the IOEither monad
func Flap ¶
func Fold ¶
func Fold[E, A, B any](onLeft func(E) I.IO[B], onRight func(A) I.IO[B]) func(IOEither[E, A]) I.IO[B]
Fold converts an IOEither into an IO
func FromIOOption ¶
func FromOption ¶
func FromStrictEquals ¶
func FromStrictEquals[E, A comparable]() EQ.Eq[IOEither[E, A]]
FromStrictEquals constructs an [EQ.Eq] from the canonical comparison function
func Functor ¶
Functor returns the functor operations for IOEither
func GetOrElse ¶
GetOrElse extracts the value or maps the error
func Let ¶
func Let[E, S1, S2, T any]( setter func(T) func(S1) S2, f func(S1) T, ) func(IOEither[E, S1]) IOEither[E, S2]
Let attaches the result of a computation to a context [S1] to produce a context [S2]
func LetTo ¶
func LetTo[E, S1, S2, T any]( setter func(T) func(S1) S2, b T, ) func(IOEither[E, S1]) IOEither[E, S2]
LetTo attaches the a value to a context [S1] to produce a context [S2]
func LogJSON ¶
LogJSON converts the argument to pretty printed JSON and then logs it via the format string Can be used with ChainFirst
func LogJson ¶
LogJson converts the argument to pretty printed JSON and then logs it via the format string Can be used with ChainFirst
Deprecated: use LogJSON instead
func Map ¶
func MapLeft ¶
func MapTo ¶
func Monad ¶
Monad returns the monadic operations for IOEither
func Pointed ¶
Pointed returns the pointed operations for IOEither
func ToIOOption ¶
ToIOOption converts an IOEither to an [IOO.IOOption]
func TraverseArray ¶
TraverseArray transforms an array
func TraverseArrayPar ¶
TraverseArrayPar transforms an array
func TraverseArraySeq ¶
TraverseArraySeq transforms an array
func TraverseArrayWithIndex ¶
TraverseArrayWithIndex transforms an array
func TraverseArrayWithIndexPar ¶
func TraverseArrayWithIndexPar[E, A, B any](f func(int, A) IOEither[E, B]) func([]A) IOEither[E, []B]
TraverseArrayWithIndexPar transforms an array
func TraverseArrayWithIndexSeq ¶
func TraverseArrayWithIndexSeq[E, A, B any](f func(int, A) IOEither[E, B]) func([]A) IOEither[E, []B]
TraverseArrayWithIndexSeq transforms an array
func TraverseRecord ¶
func TraverseRecord[K comparable, E, A, B any](f func(A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
TraverseRecord transforms a record
func TraverseRecordPar ¶
func TraverseRecordPar[K comparable, E, A, B any](f func(A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
TraverseRecordPar transforms a record
func TraverseRecordSeq ¶
func TraverseRecordSeq[K comparable, E, A, B any](f func(A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
TraverseRecordSeq transforms a record
func TraverseRecordWithIndex ¶
func TraverseRecordWithIndex[K comparable, E, A, B any](f func(K, A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
TraverseRecordWithIndex transforms a record
func TraverseRecordWithIndexPar ¶
func TraverseRecordWithIndexPar[K comparable, E, A, B any](f func(K, A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
TraverseRecordWithIndexPar transforms a record
func TraverseRecordWithIndexSeq ¶
func TraverseRecordWithIndexSeq[K comparable, E, A, B any](f func(K, A) IOEither[E, B]) func(map[K]A) IOEither[E, map[K]B]
TraverseRecordWithIndexSeq transforms a record
func TraverseTuple1 ¶
func TraverseTuple1[F1 ~func(A1) IOEither[E, T1], E, A1, T1 any](f1 F1) func(T.Tuple1[A1]) IOEither[E, T.Tuple1[T1]]
TraverseTuple1 converts a [T.Tuple1[IOEither[E, T]]] into a [IOEither[E, T.Tuple1[T1]]]
func TraverseTuple10 ¶
func TraverseTuple10[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], F10 ~func(A10) IOEither[E, T10], E, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(T.Tuple10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
TraverseTuple10 converts a [T.Tuple10[IOEither[E, T]]] into a [IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func TraverseTuple2 ¶
func TraverseTuple2[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], E, A1, A2, T1, T2 any](f1 F1, f2 F2) func(T.Tuple2[A1, A2]) IOEither[E, T.Tuple2[T1, T2]]
TraverseTuple2 converts a [T.Tuple2[IOEither[E, T]]] into a [IOEither[E, T.Tuple2[T1, T2]]]
func TraverseTuple3 ¶
func TraverseTuple3[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], E, A1, A2, A3, T1, T2, T3 any](f1 F1, f2 F2, f3 F3) func(T.Tuple3[A1, A2, A3]) IOEither[E, T.Tuple3[T1, T2, T3]]
TraverseTuple3 converts a [T.Tuple3[IOEither[E, T]]] into a [IOEither[E, T.Tuple3[T1, T2, T3]]]
func TraverseTuple4 ¶
func TraverseTuple4[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], E, A1, A2, A3, A4, T1, T2, T3, T4 any](f1 F1, f2 F2, f3 F3, f4 F4) func(T.Tuple4[A1, A2, A3, A4]) IOEither[E, T.Tuple4[T1, T2, T3, T4]]
TraverseTuple4 converts a [T.Tuple4[IOEither[E, T]]] into a [IOEither[E, T.Tuple4[T1, T2, T3, T4]]]
func TraverseTuple5 ¶
func TraverseTuple5[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], E, A1, A2, A3, A4, A5, T1, T2, T3, T4, T5 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(T.Tuple5[A1, A2, A3, A4, A5]) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]
TraverseTuple5 converts a [T.Tuple5[IOEither[E, T]]] into a [IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]]
func TraverseTuple6 ¶
func TraverseTuple6[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], E, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(T.Tuple6[A1, A2, A3, A4, A5, A6]) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]
TraverseTuple6 converts a [T.Tuple6[IOEither[E, T]]] into a [IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]]
func TraverseTuple7 ¶
func TraverseTuple7[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], E, A1, A2, A3, A4, A5, A6, A7, T1, T2, T3, T4, T5, T6, T7 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(T.Tuple7[A1, A2, A3, A4, A5, A6, A7]) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
TraverseTuple7 converts a [T.Tuple7[IOEither[E, T]]] into a [IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func TraverseTuple8 ¶
func TraverseTuple8[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], E, A1, A2, A3, A4, A5, A6, A7, A8, T1, T2, T3, T4, T5, T6, T7, T8 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(T.Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
TraverseTuple8 converts a [T.Tuple8[IOEither[E, T]]] into a [IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func TraverseTuple9 ¶
func TraverseTuple9[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], E, A1, A2, A3, A4, A5, A6, A7, A8, A9, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(T.Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
TraverseTuple9 converts a [T.Tuple9[IOEither[E, T]]] into a [IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func Uneitherize0 ¶
Uneitherize0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [IOEither[error, R]]
func Uneitherize1 ¶
Uneitherize1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [IOEither[error, R]]
func Uneitherize10 ¶
func Uneitherize10[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) (R, error)
Uneitherize10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [IOEither[error, R]]
func Uneitherize2 ¶
Uneitherize2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [IOEither[error, R]]
func Uneitherize3 ¶
func Uneitherize3[F ~func(T1, T2, T3) IOEither[error, R], T1, T2, T3, R any](f F) func(T1, T2, T3) (R, error)
Uneitherize3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [IOEither[error, R]]
func Uneitherize4 ¶
func Uneitherize4[F ~func(T1, T2, T3, T4) IOEither[error, R], T1, T2, T3, T4, R any](f F) func(T1, T2, T3, T4) (R, error)
Uneitherize4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [IOEither[error, R]]
func Uneitherize5 ¶
func Uneitherize5[F ~func(T1, T2, T3, T4, T5) IOEither[error, R], T1, T2, T3, T4, T5, R any](f F) func(T1, T2, T3, T4, T5) (R, error)
Uneitherize5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [IOEither[error, R]]
func Uneitherize6 ¶
func Uneitherize6[F ~func(T1, T2, T3, T4, T5, T6) IOEither[error, R], T1, T2, T3, T4, T5, T6, R any](f F) func(T1, T2, T3, T4, T5, T6) (R, error)
Uneitherize6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [IOEither[error, R]]
func Uneitherize7 ¶
func Uneitherize7[F ~func(T1, T2, T3, T4, T5, T6, T7) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T1, T2, T3, T4, T5, T6, T7) (R, error)
Uneitherize7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [IOEither[error, R]]
func Uneitherize8 ¶
func Uneitherize8[F ~func(T1, T2, T3, T4, T5, T6, T7, T8) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8) (R, error)
Uneitherize8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [IOEither[error, R]]
func Uneitherize9 ¶
func Uneitherize9[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9) IOEither[error, R], T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error)
Uneitherize9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [IOEither[error, R]]
func WithLock ¶
WithLock executes the provided IO operation in the scope of a lock
func WithResource ¶
func WithResource[A, E, R, ANY any](onCreate IOEither[E, R], onRelease func(R) IOEither[E, ANY]) func(func(R) IOEither[E, A]) IOEither[E, A]
WithResource constructs a function that creates a resource, then operates on it and then releases the resource
Types ¶
type IOEither ¶
IOEither represents a synchronous computation that may fail
refer to [https://andywhite.xyz/posts/2021-01-27-rte-foundations/#ioeitherlte-agt] for more details
Code:
Output: Code:
Output: Code:
Output:Example (Creation)¶
{
// Build an IOEither
leftValue := Left[string](fmt.Errorf("some error"))
rightValue := Right[error]("value")
// Convert from Either
eitherValue := E.Of[error](42)
ioFromEither := FromEither(eitherValue)
// some predicate
isEven := func(num int) (int, error) {
if num%2 == 0 {
return num, nil
}
return 0, fmt.Errorf("%d is an odd number", num)
}
fromEven := Eitherize1(isEven)
leftFromPred := fromEven(3)
rightFromPred := fromEven(4)
fmt.Println(leftValue())
fmt.Println(rightValue())
fmt.Println(ioFromEither())
fmt.Println(leftFromPred())
fmt.Println(rightFromPred())
// Output:
// Left[*errors.errorString](some error)
// Right[string](value)
// Right[int](42)
// Left[*errors.errorString](3 is an odd number)
// Right[int](4)
}
Left[*errors.errorString](some error)
Right[string](value)
Right[int](42)
Left[*errors.errorString](3 is an odd number)
Right[int](4)
Example (Do)¶
{
foo := Of[error]("foo")
bar := Of[error](1)
// quux consumes the state of three bindings and returns an [IO] instead of an [IOEither]
quux := func(t T.Tuple3[string, int, string]) IO.IO[any] {
return IO.FromImpure(func() {
log.Printf("t1: %s, t2: %d, t3: %s", t.F1, t.F2, t.F3)
})
}
transform := func(t T.Tuple3[string, int, string]) int {
return len(t.F1) + t.F2 + len(t.F3)
}
b := F.Pipe5(
foo,
BindTo[error](T.Of[string]),
ApS(T.Push1[string, int], bar),
Bind(T.Push2[string, int, string], func(t T.Tuple2[string, int]) IOEither[error, string] {
return Of[error](fmt.Sprintf("%s%d", t.F1, t.F2))
}),
ChainFirstIOK[error](quux),
Map[error](transform),
)
fmt.Println(b())
// Output:
// Right[int](8)
}
Right[int](8)
Example (Extraction)¶
{
// IOEither
someIOEither := Right[error](42)
eitherValue := someIOEither() // E.Right(42)
value := E.GetOrElse(F.Constant1[error](0))(eitherValue) // 42
// Or more directly
infaillibleIO := GetOrElse(F.Constant1[error](IO.Of(0)))(someIOEither) // => IO.Right(42)
valueFromIO := infaillibleIO() // => 42
fmt.Println(eitherValue)
fmt.Println(value)
fmt.Println(valueFromIO)
// Output:
// Right[int](42)
// 42
// 42
}
Right[int](42)
42
42
func Bracket ¶
func Bracket[E, A, B, ANY any]( acquire IOEither[E, A], use func(A) IOEither[E, B], release func(A, ET.Either[E, B]) IOEither[E, ANY], ) IOEither[E, B]
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 Defer ¶
Defer creates an IO by creating a brand new IO via a generator function, each time
func Do ¶
Bind creates an empty context of type [S] to be used with the Bind operation
func Flatten ¶
func FromEither ¶
func FromIO ¶
FromIO creates an IOEither from an [IO] instance, invoking [IO] for each invocation of IOEither
func FromImpure ¶
FromImpure converts a side effect without a return value into a side effect that returns any
func FromLazy ¶
FromLazy creates an IOEither from a [Lazy] instance, invoking [Lazy] for each invocation of IOEither
func Left ¶
func LeftIO ¶
func MakeIO ¶
func Memoize ¶
func MonadAlt ¶
MonadAlt identifies an associative operation on a type constructor
func MonadAp ¶
func MonadApFirst ¶
MonadApFirst combines two effectful actions, keeping only the result of the first.
func MonadApPar ¶
func MonadApSecond ¶
MonadApSecond combines two effectful actions, keeping only the result of the second.
func MonadApSeq ¶
func MonadBiMap ¶
func MonadChain ¶
func MonadChainEitherK ¶
func MonadChainFirst ¶
MonadChainFirst runs the IOEither monad returned by the function but returns the result of the original monad
func MonadChainFirstEitherK ¶
func MonadChainFirstEitherK[A, E, B any](ma IOEither[E, A], f func(A) ET.Either[E, B]) IOEither[E, A]
func MonadChainFirstIOK ¶
MonadChainFirstIOK runs [IO] the monad returned by the function but returns the result of the original monad
func MonadChainIOK ¶
func MonadChainTo ¶
MonadChainTo composes to the second monad ignoring the return value of the first
func MonadFlap ¶
func MonadMap ¶
func MonadMapLeft ¶
func MonadMapTo ¶
func MonadOf ¶
func Of ¶
func Retrying ¶
func Retrying[E, A any]( policy R.RetryPolicy, action func(R.RetryStatus) IOEither[E, A], check func(ET.Either[E, A]) bool, ) IOEither[E, A]
Retrying will retry the actions according to the check policy
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 Right ¶
func RightIO ¶
func SequenceArray ¶
SequenceArray converts a homogeneous sequence of either into an either of sequence
func SequenceArrayPar ¶
SequenceArrayPar converts a homogeneous Paruence of either into an either of Paruence
func SequenceArraySeq ¶
SequenceArraySeq converts a homogeneous sequence of either into an either of sequence
func SequenceRecord ¶
func SequenceRecord[K comparable, E, A any](ma map[K]IOEither[E, A]) IOEither[E, map[K]A]
SequenceRecord converts a homogeneous sequence of either into an either of sequence
func SequenceRecordPar ¶
func SequenceRecordPar[K comparable, E, A any](ma map[K]IOEither[E, A]) IOEither[E, map[K]A]
SequenceRecordPar converts a homogeneous Paruence of either into an either of Paruence
func SequenceRecordSeq ¶
func SequenceRecordSeq[K comparable, E, A any](ma map[K]IOEither[E, A]) IOEither[E, map[K]A]
SequenceRecordSeq converts a homogeneous sequence of either into an either of sequence
func SequenceT1 ¶
SequenceT1 converts 1 [IOEither[E, T]] into a [IOEither[E, T.Tuple1[T1]]]
func SequenceT10 ¶
func SequenceT10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], t8 IOEither[E, T8], t9 IOEither[E, T9], t10 IOEither[E, T10], ) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
SequenceT10 converts 10 [IOEither[E, T]] into a [IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func SequenceT2 ¶
func SequenceT2[E, T1, T2 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], ) IOEither[E, T.Tuple2[T1, T2]]
SequenceT2 converts 2 [IOEither[E, T]] into a [IOEither[E, T.Tuple2[T1, T2]]]
func SequenceT3 ¶
func SequenceT3[E, T1, T2, T3 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], ) IOEither[E, T.Tuple3[T1, T2, T3]]
SequenceT3 converts 3 [IOEither[E, T]] into a [IOEither[E, T.Tuple3[T1, T2, T3]]]
func SequenceT4 ¶
func SequenceT4[E, T1, T2, T3, T4 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], ) IOEither[E, T.Tuple4[T1, T2, T3, T4]]
SequenceT4 converts 4 [IOEither[E, T]] into a [IOEither[E, T.Tuple4[T1, T2, T3, T4]]]
func SequenceT5 ¶
func SequenceT5[E, T1, T2, T3, T4, T5 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], ) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]
SequenceT5 converts 5 [IOEither[E, T]] into a [IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]]
func SequenceT6 ¶
func SequenceT6[E, T1, T2, T3, T4, T5, T6 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], ) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]
SequenceT6 converts 6 [IOEither[E, T]] into a [IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]]
func SequenceT7 ¶
func SequenceT7[E, T1, T2, T3, T4, T5, T6, T7 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], ) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
SequenceT7 converts 7 [IOEither[E, T]] into a [IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func SequenceT8 ¶
func SequenceT8[E, T1, T2, T3, T4, T5, T6, T7, T8 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], t8 IOEither[E, T8], ) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
SequenceT8 converts 8 [IOEither[E, T]] into a [IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func SequenceT9 ¶
func SequenceT9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any]( t1 IOEither[E, T1], t2 IOEither[E, T2], t3 IOEither[E, T3], t4 IOEither[E, T4], t5 IOEither[E, T5], t6 IOEither[E, T6], t7 IOEither[E, T7], t8 IOEither[E, T8], t9 IOEither[E, T9], ) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
SequenceT9 converts 9 [IOEither[E, T]] into a [IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func SequenceTuple1 ¶
SequenceTuple1 converts a [T.Tuple1[IOEither[E, T]]] into a [IOEither[E, T.Tuple1[T1]]]
func SequenceTuple10 ¶
func SequenceTuple10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t T.Tuple10[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9], IOEither[E, T10]]) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
SequenceTuple10 converts a [T.Tuple10[IOEither[E, T]]] into a [IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func SequenceTuple2 ¶
func SequenceTuple2[E, T1, T2 any](t T.Tuple2[IOEither[E, T1], IOEither[E, T2]]) IOEither[E, T.Tuple2[T1, T2]]
SequenceTuple2 converts a [T.Tuple2[IOEither[E, T]]] into a [IOEither[E, T.Tuple2[T1, T2]]]
func SequenceTuple3 ¶
func SequenceTuple3[E, T1, T2, T3 any](t T.Tuple3[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3]]) IOEither[E, T.Tuple3[T1, T2, T3]]
SequenceTuple3 converts a [T.Tuple3[IOEither[E, T]]] into a [IOEither[E, T.Tuple3[T1, T2, T3]]]
func SequenceTuple4 ¶
func SequenceTuple4[E, T1, T2, T3, T4 any](t T.Tuple4[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4]]) IOEither[E, T.Tuple4[T1, T2, T3, T4]]
SequenceTuple4 converts a [T.Tuple4[IOEither[E, T]]] into a [IOEither[E, T.Tuple4[T1, T2, T3, T4]]]
func SequenceTuple5 ¶
func SequenceTuple5[E, T1, T2, T3, T4, T5 any](t T.Tuple5[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5]]) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]
SequenceTuple5 converts a [T.Tuple5[IOEither[E, T]]] into a [IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]]
func SequenceTuple6 ¶
func SequenceTuple6[E, T1, T2, T3, T4, T5, T6 any](t T.Tuple6[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6]]) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]
SequenceTuple6 converts a [T.Tuple6[IOEither[E, T]]] into a [IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]]
func SequenceTuple7 ¶
func SequenceTuple7[E, T1, T2, T3, T4, T5, T6, T7 any](t T.Tuple7[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7]]) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
SequenceTuple7 converts a [T.Tuple7[IOEither[E, T]]] into a [IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func SequenceTuple8 ¶
func SequenceTuple8[E, T1, T2, T3, T4, T5, T6, T7, T8 any](t T.Tuple8[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8]]) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
SequenceTuple8 converts a [T.Tuple8[IOEither[E, T]]] into a [IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func SequenceTuple9 ¶
func SequenceTuple9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t T.Tuple9[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9]]) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
SequenceTuple9 converts a [T.Tuple9[IOEither[E, T]]] into a [IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func Swap ¶
Swap changes the order of type parameters
func TryCatch ¶
func TryCatchError ¶
Source Files ¶
ap.go bind.go bracket.go doc.go eq.go gen.go ioeither.go logging.go monad.go monoid.go retry.go semigroup.go sync.go traverse.go
Directories ¶
Path | Synopsis |
---|---|
ioeither/exec | |
ioeither/file | |
ioeither/generic | Code generated by go generate; DO NOT EDIT. |
ioeither/http | |
ioeither/http/builder | |
ioeither/http/di | |
ioeither/testing |
- Version
- v1.0.151 (latest)
- Published
- Nov 23, 2024
- Platform
- linux/amd64
- Imports
- 16 packages
- Last checked
- 4 months ago –
Tools for package owners.