Documentation
¶
Index ¶
- Variables
- func After[A any](timestamp time.Time) func(IO[A]) IO[A]
- func Ap[B, A any](ma IO[A]) func(IO[func(A) B]) IO[B]
- func ApFirst[A, B any](second IO[B]) func(IO[A]) IO[A]
- func ApS[S1, S2, T any](setter func(T) func(S1) S2, fa IO[T]) func(IO[S1]) IO[S2]
- func ApSecond[A, B any](second IO[B]) func(IO[A]) IO[B]
- func ApplicativeMonoid[A any](m M.Monoid[A]) M.Monoid[IO[A]]
- func ApplySemigroup[A any](s S.Semigroup[A]) S.Semigroup[IO[A]]
- func Bind[S1, S2, T any](setter func(T) func(S1) S2, f func(S1) IO[T]) func(IO[S1]) IO[S2]
- func BindTo[S1, T any](setter func(T) S1) func(IO[T]) IO[S1]
- func Chain[A, B any](f func(A) IO[B]) func(IO[A]) IO[B]
- func ChainFirst[A, B any](f func(A) IO[B]) func(IO[A]) IO[A]
- func ChainTo[A, B any](fb IO[B]) func(IO[A]) IO[B]
- func Delay[A any](delay time.Duration) func(IO[A]) IO[A]
- func Eq[A any](e EQ.Eq[A]) EQ.Eq[IO[A]]
- func Flap[B, A any](a A) func(IO[func(A) B]) IO[B]
- func FromStrictEquals[A comparable]() EQ.Eq[IO[A]]
- func Functor[A, B any]() functor.Functor[A, B, IO[A], IO[B]]
- func Let[S1, S2, T any](setter func(T) func(S1) S2, f func(S1) T) func(IO[S1]) IO[S2]
- func LetTo[S1, S2, T any](setter func(T) func(S1) S2, b T) func(IO[S1]) IO[S2]
- func Logf[A any](prefix string) func(A) IO[any]
- func Logger[A any](loggers ...*log.Logger) func(string) func(A) IO[any]
- func Map[A, B any](f func(A) B) func(fa IO[A]) IO[B]
- func MapTo[A, B any](b B) func(IO[A]) IO[B]
- func Monad[A, B any]() monad.Monad[A, B, IO[A], IO[B], IO[func(A) B]]
- func Pointed[A any]() pointed.Pointed[A, IO[A]]
- func Printf[A any](prefix string) func(A) IO[any]
- func TraverseArray[A, B any](f func(A) IO[B]) func([]A) IO[[]B]
- func TraverseArraySeq[A, B any](f func(A) IO[B]) func([]A) IO[[]B]
- func TraverseArrayWithIndex[A, B any](f func(int, A) IO[B]) func([]A) IO[[]B]
- func TraverseArrayWithIndexSeq[A, B any](f func(int, A) IO[B]) func([]A) IO[[]B]
- func TraverseRecord[K comparable, A, B any](f func(A) IO[B]) func(map[K]A) IO[map[K]B]
- func TraverseRecordSeq[K comparable, A, B any](f func(A) IO[B]) func(map[K]A) IO[map[K]B]
- func TraverseRecordWithIndeSeq[K comparable, A, B any](f func(K, A) IO[B]) func(map[K]A) IO[map[K]B]
- func TraverseRecordWithIndex[K comparable, A, B any](f func(K, A) IO[B]) func(map[K]A) IO[map[K]B]
- func TraverseTuple1[F1 ~func(A1) IO[T1], A1, T1 any](f1 F1) func(T.Tuple1[A1]) IO[T.Tuple1[T1]]
- func TraverseTuple10[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) ...
- func TraverseTuple2[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], A1, A2, T1, T2 any](f1 F1, f2 F2) func(T.Tuple2[A1, A2]) IO[T.Tuple2[T1, T2]]
- func TraverseTuple3[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3) func(T.Tuple3[A1, A2, A3]) IO[T.Tuple3[T1, T2, T3]]
- func TraverseTuple4[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4) func(T.Tuple4[A1, A2, A3, A4]) IO[T.Tuple4[T1, T2, T3, T4]]
- func TraverseTuple5[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(T.Tuple5[A1, A2, A3, A4, A5]) IO[T.Tuple5[T1, T2, T3, T4, T5]]
- func TraverseTuple6[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(T.Tuple6[A1, A2, A3, A4, A5, A6]) IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]
- func TraverseTuple7[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) ...
- func TraverseTuple8[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) ...
- func TraverseTuple9[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], ...](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) ...
- func WithLock[A any](lock IO[context.CancelFunc]) func(fa IO[A]) IO[A]
- func WithResource[R, A, ANY any](onCreate IO[R], onRelease func(R) IO[ANY]) func(func(R) IO[A]) IO[A]
- type IO
- func Bracket[A, B, ANY any](acquire IO[A], use func(A) IO[B], release func(A, B) IO[ANY]) IO[B]
- func Defer[A any](gen func() IO[A]) IO[A]
- func Do[S any](empty S) IO[S]
- func Flatten[A any](mma IO[IO[A]]) IO[A]
- func FromIO[A any](a IO[A]) IO[A]
- func FromImpure(f func()) IO[any]
- func MakeIO[A any](f func() A) IO[A]
- func Memoize[A any](ma IO[A]) IO[A]
- func MonadAp[B, A any](mab IO[func(A) B], ma IO[A]) IO[B]
- func MonadApFirst[A, B any](first IO[A], second IO[B]) IO[A]
- func MonadApSecond[A, B any](first IO[A], second IO[B]) IO[B]
- func MonadChain[A, B any](fa IO[A], f func(A) IO[B]) IO[B]
- func MonadChainFirst[A, B any](fa IO[A], f func(A) IO[B]) IO[A]
- func MonadChainTo[A, B any](fa IO[A], fb IO[B]) IO[B]
- func MonadFlap[B, A any](fab IO[func(A) B], a A) IO[B]
- func MonadMap[A, B any](fa IO[A], f func(A) B) IO[B]
- func MonadMapTo[A, B any](fa IO[A], b B) IO[B]
- func MonadOf[A any](a A) IO[A]
- func MonadTraverseArray[A, B any](tas []A, f func(A) IO[B]) IO[[]B]
- func MonadTraverseArraySeq[A, B any](tas []A, f func(A) IO[B]) IO[[]B]
- func MonadTraverseRecord[K comparable, A, B any](tas map[K]A, f func(A) IO[B]) IO[map[K]B]
- func MonadTraverseRecordSeq[K comparable, A, B any](tas map[K]A, f func(A) IO[B]) IO[map[K]B]
- func Of[A any](a A) IO[A]
- func Retrying[A any](policy R.RetryPolicy, action func(R.RetryStatus) IO[A], check func(A) bool) IO[A]
- func SequenceArray[A any](tas []IO[A]) IO[[]A]
- func SequenceArraySeq[A any](tas []IO[A]) IO[[]A]
- func SequenceRecord[K comparable, A any](tas map[K]IO[A]) IO[map[K]A]
- func SequenceRecordSeq[K comparable, A any](tas map[K]IO[A]) IO[map[K]A]
- func SequenceT1[T1 any](t1 IO[T1]) IO[T.Tuple1[T1]]
- func SequenceT10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], ...) IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
- func SequenceT2[T1, T2 any](t1 IO[T1], t2 IO[T2]) IO[T.Tuple2[T1, T2]]
- func SequenceT3[T1, T2, T3 any](t1 IO[T1], t2 IO[T2], t3 IO[T3]) IO[T.Tuple3[T1, T2, T3]]
- func SequenceT4[T1, T2, T3, T4 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4]) IO[T.Tuple4[T1, T2, T3, T4]]
- func SequenceT5[T1, T2, T3, T4, T5 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5]) IO[T.Tuple5[T1, T2, T3, T4, T5]]
- func SequenceT6[T1, T2, T3, T4, T5, T6 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6]) IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]
- func SequenceT7[T1, T2, T3, T4, T5, T6, T7 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7]) IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
- func SequenceT8[T1, T2, T3, T4, T5, T6, T7, T8 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], ...) IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
- func SequenceT9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], ...) IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
- func SequenceTuple1[T1 any](t T.Tuple1[IO[T1]]) IO[T.Tuple1[T1]]
- func SequenceTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](...) IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
- func SequenceTuple2[T1, T2 any](t T.Tuple2[IO[T1], IO[T2]]) IO[T.Tuple2[T1, T2]]
- func SequenceTuple3[T1, T2, T3 any](t T.Tuple3[IO[T1], IO[T2], IO[T3]]) IO[T.Tuple3[T1, T2, T3]]
- func SequenceTuple4[T1, T2, T3, T4 any](t T.Tuple4[IO[T1], IO[T2], IO[T3], IO[T4]]) IO[T.Tuple4[T1, T2, T3, T4]]
- func SequenceTuple5[T1, T2, T3, T4, T5 any](t T.Tuple5[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5]]) IO[T.Tuple5[T1, T2, T3, T4, T5]]
- func SequenceTuple6[T1, T2, T3, T4, T5, T6 any](t T.Tuple6[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6]]) IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]
- func SequenceTuple7[T1, T2, T3, T4, T5, T6, T7 any](t T.Tuple7[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6], IO[T7]]) IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
- func SequenceTuple8[T1, T2, T3, T4, T5, T6, T7, T8 any](t T.Tuple8[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6], IO[T7], IO[T8]]) IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
- func SequenceTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](...) IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
- func WithDuration[A any](a IO[A]) IO[T.Tuple2[A, time.Duration]]
- func WithTime[A any](a IO[A]) IO[T.Tuple3[A, time.Time, time.Time]]
Constants ¶
This section is empty.
Variables ¶
Now returns the current timestamp
Functions ¶
func ApS ¶ added in v1.0.107
ApS attaches a value to a context [S1] to produce a context [S2] by considering the context and the value concurrently
func Bind ¶ added in v1.0.107
Bind attaches the result of a computation to a context [S1] to produce a context [S2]
func Chain ¶
Chain composes computations in sequence, using the return value of one computation to determine the next computation.
func ChainFirst ¶
ChainFirst composes computations in sequence, using the return value of one computation to determine the next computation and keeping only the result of the first.
func ChainTo ¶
ChainTo composes computations in sequence, ignoring the return value of the first computation
func FromStrictEquals ¶ added in v1.0.145
func FromStrictEquals[A comparable]() EQ.Eq[IO[A]]
FromStrictEquals constructs an [EQ.Eq] from the canonical comparison function
func Let ¶ added in v1.0.107
Let attaches the result of a computation to a context [S1] to produce a context [S2]
func LetTo ¶ added in v1.0.107
LetTo attaches the a value to a context [S1] to produce a context [S2]
func Logf ¶
Logf constructs a logger function that can be used with ChainXXXIOK the string prefix contains the format string for the log value
func Printf ¶ added in v1.0.6
Printf constructs a printer function that can be used with ChainXXXIOK the string prefix contains the format string for the log value
func TraverseArray ¶
TraverseArray applies a function returning an IO to all elements in an array and the transforms this into an IO of that array
func TraverseArraySeq ¶ added in v1.0.132
TraverseArraySeq applies a function returning an IO to all elements in an array and the transforms this into an IO of that array
func TraverseArrayWithIndex ¶ added in v1.0.29
TraverseArrayWithIndex applies a function returning an IO to all elements in an array and the transforms this into an IO of that array
func TraverseArrayWithIndexSeq ¶ added in v1.0.132
TraverseArrayWithIndexSeq applies a function returning an IO to all elements in an array and the transforms this into an IO of that array
func TraverseRecord ¶
func TraverseRecord[K comparable, A, B any](f func(A) IO[B]) func(map[K]A) IO[map[K]B]
TraverseRecord applies a function returning an IO to all elements in a record and the transforms this into an IO of that record
func TraverseRecordSeq ¶ added in v1.0.132
func TraverseRecordSeq[K comparable, A, B any](f func(A) IO[B]) func(map[K]A) IO[map[K]B]
TraverseRecord applies a function returning an IO to all elements in a record and the transforms this into an IO of that record
func TraverseRecordWithIndeSeq ¶ added in v1.0.132
func TraverseRecordWithIndeSeq[K comparable, A, B any](f func(K, A) IO[B]) func(map[K]A) IO[map[K]B]
TraverseRecordWithIndexSeq applies a function returning an IO to all elements in a record and the transforms this into an IO of that record
func TraverseRecordWithIndex ¶ added in v1.0.29
func TraverseRecordWithIndex[K comparable, A, B any](f func(K, A) IO[B]) func(map[K]A) IO[map[K]B]
TraverseRecordWithIndex applies a function returning an IO to all elements in a record and the transforms this into an IO of that record
func TraverseTuple1 ¶ added in v1.0.7
TraverseTuple1 converts a [T.Tuple1[IO[T]]] into a [IO[T.Tuple1[T1]]]
func TraverseTuple10 ¶ added in v1.0.7
func TraverseTuple10[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], F5 ~func(A5) IO[T5], F6 ~func(A6) IO[T6], F7 ~func(A7) IO[T7], F8 ~func(A8) IO[T8], F9 ~func(A9) IO[T9], F10 ~func(A10) IO[T10], 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]) IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
TraverseTuple10 converts a [T.Tuple10[IO[T]]] into a [IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func TraverseTuple2 ¶ added in v1.0.7
func TraverseTuple2[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], A1, A2, T1, T2 any](f1 F1, f2 F2) func(T.Tuple2[A1, A2]) IO[T.Tuple2[T1, T2]]
TraverseTuple2 converts a [T.Tuple2[IO[T]]] into a [IO[T.Tuple2[T1, T2]]]
func TraverseTuple3 ¶ added in v1.0.7
func TraverseTuple3[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], A1, A2, A3, T1, T2, T3 any](f1 F1, f2 F2, f3 F3) func(T.Tuple3[A1, A2, A3]) IO[T.Tuple3[T1, T2, T3]]
TraverseTuple3 converts a [T.Tuple3[IO[T]]] into a [IO[T.Tuple3[T1, T2, T3]]]
func TraverseTuple4 ¶ added in v1.0.7
func TraverseTuple4[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], A1, A2, A3, A4, T1, T2, T3, T4 any](f1 F1, f2 F2, f3 F3, f4 F4) func(T.Tuple4[A1, A2, A3, A4]) IO[T.Tuple4[T1, T2, T3, T4]]
TraverseTuple4 converts a [T.Tuple4[IO[T]]] into a [IO[T.Tuple4[T1, T2, T3, T4]]]
func TraverseTuple5 ¶ added in v1.0.7
func TraverseTuple5[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], F5 ~func(A5) IO[T5], 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]) IO[T.Tuple5[T1, T2, T3, T4, T5]]
TraverseTuple5 converts a [T.Tuple5[IO[T]]] into a [IO[T.Tuple5[T1, T2, T3, T4, T5]]]
func TraverseTuple6 ¶ added in v1.0.7
func TraverseTuple6[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], F5 ~func(A5) IO[T5], F6 ~func(A6) IO[T6], 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]) IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]
TraverseTuple6 converts a [T.Tuple6[IO[T]]] into a [IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]]
func TraverseTuple7 ¶ added in v1.0.7
func TraverseTuple7[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], F5 ~func(A5) IO[T5], F6 ~func(A6) IO[T6], F7 ~func(A7) IO[T7], 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]) IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
TraverseTuple7 converts a [T.Tuple7[IO[T]]] into a [IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func TraverseTuple8 ¶ added in v1.0.7
func TraverseTuple8[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], F5 ~func(A5) IO[T5], F6 ~func(A6) IO[T6], F7 ~func(A7) IO[T7], F8 ~func(A8) IO[T8], 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]) IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
TraverseTuple8 converts a [T.Tuple8[IO[T]]] into a [IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func TraverseTuple9 ¶ added in v1.0.7
func TraverseTuple9[F1 ~func(A1) IO[T1], F2 ~func(A2) IO[T2], F3 ~func(A3) IO[T3], F4 ~func(A4) IO[T4], F5 ~func(A5) IO[T5], F6 ~func(A6) IO[T6], F7 ~func(A7) IO[T7], F8 ~func(A8) IO[T8], F9 ~func(A9) IO[T9], 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]) IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
TraverseTuple9 converts a [T.Tuple9[IO[T]]] into a [IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
Types ¶
type IO ¶
type IO[A any] func() A
IO represents a synchronous computation that cannot fail refer to [https://andywhite.xyz/posts/2021-01-27-rte-foundations/#ioltagt] for more details
func Bracket ¶ added in v1.0.50
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 Do ¶ added in v1.0.107
Bind creates an empty context of type [S] to be used with the Bind operation
func FromImpure ¶
FromImpure converts a side effect without a return value into a side effect that returns any
func MonadApFirst ¶
MonadApFirst combines two effectful actions, keeping only the result of the first.
func MonadApSecond ¶
MonadApSecond combines two effectful actions, keeping only the result of the second.
func MonadChain ¶
MonadChain composes computations in sequence, using the return value of one computation to determine the next computation.
func MonadChainFirst ¶
MonadChainFirst composes computations in sequence, using the return value of one computation to determine the next computation and keeping only the result of the first.
func MonadChainTo ¶
MonadChainTo composes computations in sequence, ignoring the return value of the first computation
func MonadMapTo ¶
func MonadTraverseArray ¶
func MonadTraverseArraySeq ¶ added in v1.0.132
func MonadTraverseRecord ¶
func MonadTraverseRecord[K comparable, A, B any](tas map[K]A, f func(A) IO[B]) IO[map[K]B]
func MonadTraverseRecordSeq ¶ added in v1.0.132
func MonadTraverseRecordSeq[K comparable, A, B any](tas map[K]A, f func(A) IO[B]) IO[map[K]B]
func Retrying ¶
func Retrying[A any]( policy R.RetryPolicy, action func(R.RetryStatus) IO[A], check func(A) bool, ) IO[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 SequenceArray ¶
func SequenceArraySeq ¶ added in v1.0.132
SequenceArraySeq converts an array of IO to an IO of an array
func SequenceRecord ¶
func SequenceRecord[K comparable, A any](tas map[K]IO[A]) IO[map[K]A]
func SequenceRecordSeq ¶ added in v1.0.132
func SequenceRecordSeq[K comparable, A any](tas map[K]IO[A]) IO[map[K]A]
SequenceRecordSeq converts a record of IO to an IO of a record
func SequenceT1 ¶
SequenceT1 converts 1 [IO[T]] into a [IO[T.Tuple1[T1]]]
func SequenceT10 ¶ added in v1.0.7
func SequenceT10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], t8 IO[T8], t9 IO[T9], t10 IO[T10], ) IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
SequenceT10 converts 10 [IO[T]] into a [IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func SequenceT2 ¶
SequenceT2 converts 2 [IO[T]] into a [IO[T.Tuple2[T1, T2]]]
func SequenceT3 ¶
SequenceT3 converts 3 [IO[T]] into a [IO[T.Tuple3[T1, T2, T3]]]
func SequenceT4 ¶
func SequenceT4[T1, T2, T3, T4 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], ) IO[T.Tuple4[T1, T2, T3, T4]]
SequenceT4 converts 4 [IO[T]] into a [IO[T.Tuple4[T1, T2, T3, T4]]]
func SequenceT5 ¶ added in v1.0.7
func SequenceT5[T1, T2, T3, T4, T5 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], ) IO[T.Tuple5[T1, T2, T3, T4, T5]]
SequenceT5 converts 5 [IO[T]] into a [IO[T.Tuple5[T1, T2, T3, T4, T5]]]
func SequenceT6 ¶ added in v1.0.7
func SequenceT6[T1, T2, T3, T4, T5, T6 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], ) IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]
SequenceT6 converts 6 [IO[T]] into a [IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]]
func SequenceT7 ¶ added in v1.0.7
func SequenceT7[T1, T2, T3, T4, T5, T6, T7 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], ) IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
SequenceT7 converts 7 [IO[T]] into a [IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func SequenceT8 ¶ added in v1.0.7
func SequenceT8[T1, T2, T3, T4, T5, T6, T7, T8 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], t8 IO[T8], ) IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
SequenceT8 converts 8 [IO[T]] into a [IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func SequenceT9 ¶ added in v1.0.7
func SequenceT9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any]( t1 IO[T1], t2 IO[T2], t3 IO[T3], t4 IO[T4], t5 IO[T5], t6 IO[T6], t7 IO[T7], t8 IO[T8], t9 IO[T9], ) IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
SequenceT9 converts 9 [IO[T]] into a [IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func SequenceTuple1 ¶ added in v1.0.7
SequenceTuple1 converts a [T.Tuple1[IO[T]]] into a [IO[T.Tuple1[T1]]]
func SequenceTuple10 ¶ added in v1.0.7
func SequenceTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t T.Tuple10[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6], IO[T7], IO[T8], IO[T9], IO[T10]]) IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]
SequenceTuple10 converts a [T.Tuple10[IO[T]]] into a [IO[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func SequenceTuple2 ¶ added in v1.0.7
SequenceTuple2 converts a [T.Tuple2[IO[T]]] into a [IO[T.Tuple2[T1, T2]]]
func SequenceTuple3 ¶ added in v1.0.7
SequenceTuple3 converts a [T.Tuple3[IO[T]]] into a [IO[T.Tuple3[T1, T2, T3]]]
func SequenceTuple4 ¶ added in v1.0.7
func SequenceTuple4[T1, T2, T3, T4 any](t T.Tuple4[IO[T1], IO[T2], IO[T3], IO[T4]]) IO[T.Tuple4[T1, T2, T3, T4]]
SequenceTuple4 converts a [T.Tuple4[IO[T]]] into a [IO[T.Tuple4[T1, T2, T3, T4]]]
func SequenceTuple5 ¶ added in v1.0.7
func SequenceTuple5[T1, T2, T3, T4, T5 any](t T.Tuple5[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5]]) IO[T.Tuple5[T1, T2, T3, T4, T5]]
SequenceTuple5 converts a [T.Tuple5[IO[T]]] into a [IO[T.Tuple5[T1, T2, T3, T4, T5]]]
func SequenceTuple6 ¶ added in v1.0.7
func SequenceTuple6[T1, T2, T3, T4, T5, T6 any](t T.Tuple6[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6]]) IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]
SequenceTuple6 converts a [T.Tuple6[IO[T]]] into a [IO[T.Tuple6[T1, T2, T3, T4, T5, T6]]]
func SequenceTuple7 ¶ added in v1.0.7
func SequenceTuple7[T1, T2, T3, T4, T5, T6, T7 any](t T.Tuple7[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6], IO[T7]]) IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]
SequenceTuple7 converts a [T.Tuple7[IO[T]]] into a [IO[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func SequenceTuple8 ¶ added in v1.0.7
func SequenceTuple8[T1, T2, T3, T4, T5, T6, T7, T8 any](t T.Tuple8[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6], IO[T7], IO[T8]]) IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]
SequenceTuple8 converts a [T.Tuple8[IO[T]]] into a [IO[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func SequenceTuple9 ¶ added in v1.0.7
func SequenceTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t T.Tuple9[IO[T1], IO[T2], IO[T3], IO[T4], IO[T5], IO[T6], IO[T7], IO[T8], IO[T9]]) IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]
SequenceTuple9 converts a [T.Tuple9[IO[T]]] into a [IO[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func WithDuration ¶ added in v1.0.106
WithDuration returns an operation that measures the time.Duration