package io

import "github.com/IBM/fp-go/io"

Index

Variables

var Now = G.Now[IO[time.Time]]()

Now returns the current timestamp

Functions

func After

func After[A any](timestamp time.Time) func(IO[A]) IO[A]

After creates an operation that passes after the given timestamp

func Ap

func Ap[B, A any](ma IO[A]) func(IO[func(A) B]) IO[B]

func ApFirst

func ApFirst[A, B any](second IO[B]) func(IO[A]) IO[A]

ApFirst combines two effectful actions, keeping only the result of the first.

func ApS

func ApS[S1, S2, T any](
	setter func(T) func(S1) S2,
	fa IO[T],
) func(IO[S1]) IO[S2]

ApS attaches a value to a context [S1] to produce a context [S2] by considering the context and the value concurrently

func ApSecond

func ApSecond[A, B any](second IO[B]) func(IO[A]) IO[B]

ApSecond combines two effectful actions, keeping only the result of the second.

func ApplicativeMonoid

func ApplicativeMonoid[A any](m M.Monoid[A]) M.Monoid[IO[A]]

func ApplySemigroup

func ApplySemigroup[A any](s S.Semigroup[A]) S.Semigroup[IO[A]]

func Bind

func Bind[S1, S2, T any](
	setter func(T) func(S1) S2,
	f func(S1) IO[T],
) func(IO[S1]) IO[S2]

Bind attaches the result of a computation to a context [S1] to produce a context [S2]

func BindTo

func BindTo[S1, T any](
	setter func(T) S1,
) func(IO[T]) IO[S1]

BindTo initializes a new state [S1] from a value [T]

func Chain

func Chain[A, B any](f func(A) IO[B]) func(IO[A]) IO[B]

Chain composes computations in sequence, using the return value of one computation to determine the next computation.

func ChainFirst

func ChainFirst[A, B any](f func(A) IO[B]) func(IO[A]) IO[A]

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

func ChainTo[A, B any](fb IO[B]) func(IO[A]) IO[B]

ChainTo composes computations in sequence, ignoring the return value of the first computation

func Delay

func Delay[A any](delay time.Duration) func(IO[A]) IO[A]

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

func Eq

func Eq[A any](e EQ.Eq[A]) EQ.Eq[IO[A]]

Eq implements the equals predicate for values contained in the IO monad

func Flap

func Flap[B, A any](a A) func(IO[func(A) B]) IO[B]

func FromStrictEquals

func FromStrictEquals[A comparable]() EQ.Eq[IO[A]]

FromStrictEquals constructs an [EQ.Eq] from the canonical comparison function

func Functor

func Functor[A, B any]() functor.Functor[A, B, IO[A], IO[B]]

Functor returns the monadic operations for IO

func Let

func Let[S1, S2, T any](
	setter func(T) func(S1) S2,
	f func(S1) T,
) func(IO[S1]) IO[S2]

Let attaches the result of a computation to a context [S1] to produce a context [S2]

func LetTo

func LetTo[S1, S2, T any](
	setter func(T) func(S1) S2,
	b T,
) func(IO[S1]) IO[S2]

LetTo attaches the a value to a context [S1] to produce a context [S2]

func Logf

func Logf[A any](prefix string) func(A) IO[any]

Logf constructs a logger function that can be used with ChainXXXIOK the string prefix contains the format string for the log value

func Logger

func Logger[A any](loggers ...*log.Logger) func(string) func(A) IO[any]

Logger constructs a logger function that can be used with ChainXXXIOK

func Map

func Map[A, B any](f func(A) B) func(fa IO[A]) IO[B]

func MapTo

func MapTo[A, B any](b B) func(IO[A]) IO[B]

func Monad

func Monad[A, B any]() monad.Monad[A, B, IO[A], IO[B], IO[func(A) B]]

Monad returns the monadic operations for IO

func Pointed

func Pointed[A any]() pointed.Pointed[A, IO[A]]

Pointed returns the monadic operations for IO

func Printf

func Printf[A any](prefix string) func(A) IO[any]

Printf constructs a printer function that can be used with ChainXXXIOK the string prefix contains the format string for the log value

func TraverseArray

func TraverseArray[A, B any](f func(A) IO[B]) func([]A) IO[[]B]

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

func TraverseArraySeq[A, B any](f func(A) IO[B]) func([]A) IO[[]B]

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

func TraverseArrayWithIndex[A, B any](f func(int, A) IO[B]) func([]A) IO[[]B]

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

func TraverseArrayWithIndexSeq[A, B any](f func(int, A) IO[B]) func([]A) IO[[]B]

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

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

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

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

func TraverseTuple1[F1 ~func(A1) IO[T1], A1, T1 any](f1 F1) func(T.Tuple1[A1]) IO[T.Tuple1[T1]]

TraverseTuple1 converts a [T.Tuple1[IO[T]]] into a [IO[T.Tuple1[T1]]]

func TraverseTuple10

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

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

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

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

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

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

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

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

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]]]

func WithLock

func WithLock[A any](lock IO[context.CancelFunc]) func(fa IO[A]) IO[A]

WithLock executes the provided IO operation in the scope of a lock

func WithResource

func WithResource[
	R, A, ANY any](onCreate IO[R], onRelease func(R) IO[ANY]) func(func(R) IO[A]) IO[A]

WithResource constructs a function that creates a resource, then operates on it and then releases the resource

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

func Bracket[A, B, ANY any](
	acquire IO[A],
	use func(A) IO[B],
	release func(A, B) IO[ANY],
) IO[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

func Defer[A any](gen func() IO[A]) IO[A]

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

func Do

func Do[S any](
	empty S,
) IO[S]

Bind creates an empty context of type [S] to be used with the Bind operation

func Flatten

func Flatten[A any](mma IO[IO[A]]) IO[A]

func FromIO

func FromIO[A any](a IO[A]) IO[A]

func FromImpure

func FromImpure(f func()) IO[any]

FromImpure converts a side effect without a return value into a side effect that returns any

func MakeIO

func MakeIO[A any](f func() A) IO[A]

func Memoize

func Memoize[A any](ma IO[A]) IO[A]

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

func MonadAp

func MonadAp[B, A any](mab IO[func(A) B], ma IO[A]) IO[B]

func MonadApFirst

func MonadApFirst[A, B any](first IO[A], second IO[B]) IO[A]

MonadApFirst combines two effectful actions, keeping only the result of the first.

func MonadApSecond

func MonadApSecond[A, B any](first IO[A], second IO[B]) IO[B]

MonadApSecond combines two effectful actions, keeping only the result of the second.

func MonadChain

func MonadChain[A, B any](fa IO[A], f func(A) IO[B]) IO[B]

MonadChain composes computations in sequence, using the return value of one computation to determine the next computation.

func MonadChainFirst

func MonadChainFirst[A, B any](fa IO[A], f func(A) IO[B]) IO[A]

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

func MonadChainTo[A, B any](fa IO[A], fb IO[B]) IO[B]

MonadChainTo composes computations in sequence, ignoring the return value of the first computation

func MonadFlap

func MonadFlap[B, A any](fab IO[func(A) B], a A) IO[B]

func MonadMap

func MonadMap[A, B any](fa IO[A], f func(A) B) IO[B]

func MonadMapTo

func MonadMapTo[A, B any](fa IO[A], b B) IO[B]

func MonadOf

func MonadOf[A any](a A) IO[A]

func MonadTraverseArray

func MonadTraverseArray[A, B any](tas []A, f func(A) IO[B]) IO[[]B]

func MonadTraverseArraySeq

func MonadTraverseArraySeq[A, B any](tas []A, f func(A) IO[B]) IO[[]B]

func MonadTraverseRecord

func MonadTraverseRecord[K comparable, A, B any](tas map[K]A, f func(A) IO[B]) IO[map[K]B]

func MonadTraverseRecordSeq

func MonadTraverseRecordSeq[K comparable, A, B any](tas map[K]A, f func(A) IO[B]) IO[map[K]B]

func Of

func Of[A any](a A) IO[A]

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 SequenceArray[A any](tas []IO[A]) IO[[]A]

SequenceArray converts an array of IO to an IO of an array

func SequenceArraySeq

func SequenceArraySeq[A any](tas []IO[A]) IO[[]A]

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]

SequenceRecord converts a record of IO to an IO of a record

func SequenceRecordSeq

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

func SequenceT1[T1 any](
	t1 IO[T1],
) IO[T.Tuple1[T1]]

SequenceT1 converts 1 [IO[T]] into a [IO[T.Tuple1[T1]]]

func SequenceT10

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

func SequenceT2[T1, T2 any](
	t1 IO[T1],
	t2 IO[T2],
) IO[T.Tuple2[T1, T2]]

SequenceT2 converts 2 [IO[T]] into a [IO[T.Tuple2[T1, T2]]]

func SequenceT3

func SequenceT3[T1, T2, T3 any](
	t1 IO[T1],
	t2 IO[T2],
	t3 IO[T3],
) IO[T.Tuple3[T1, T2, T3]]

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

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

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

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

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

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

func SequenceTuple1[T1 any](t T.Tuple1[IO[T1]]) IO[T.Tuple1[T1]]

SequenceTuple1 converts a [T.Tuple1[IO[T]]] into a [IO[T.Tuple1[T1]]]

func SequenceTuple10

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

func SequenceTuple2[T1, T2 any](t T.Tuple2[IO[T1], IO[T2]]) IO[T.Tuple2[T1, T2]]

SequenceTuple2 converts a [T.Tuple2[IO[T]]] into a [IO[T.Tuple2[T1, T2]]]

func SequenceTuple3

func SequenceTuple3[T1, T2, T3 any](t T.Tuple3[IO[T1], IO[T2], IO[T3]]) IO[T.Tuple3[T1, T2, T3]]

SequenceTuple3 converts a [T.Tuple3[IO[T]]] into a [IO[T.Tuple3[T1, T2, T3]]]

func SequenceTuple4

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

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

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

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

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

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

func WithDuration[A any](a IO[A]) IO[T.Tuple2[A, time.Duration]]

WithDuration returns an operation that measures the time.Duration

func WithTime

func WithTime[A any](a IO[A]) IO[T.Tuple3[A, time.Time, time.Time]]

WithTime returns an operation that measures the start and end time.Time of the operation

Source Files

apply.go bind.go bracket.go doc.go eq.go functor.go gen.go io.go logging.go monad.go pointed.go resource.go retry.go sync.go traverse.go

Directories

PathSynopsis
io/file
io/genericCode generated by go generate; DO NOT EDIT.
io/testing
Version
v1.0.151 (latest)
Published
Nov 23, 2024
Platform
linux/amd64
Imports
12 packages
Last checked
4 months ago

Tools for package owners.