Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Primetalk/goio
/ functions
Functions
426 in github.com/Primetalk/goio
⨍
Functions
426
◇
Types & classes
31
↓ 50 callers
Function
Lift
Lift[A] constructs an IO[A] from a constant value.
io/io.go:144
↓ 40 callers
Function
Map
Map converts the IO[A] result using the provided function that cannot fail.
io/io.go:100
↓ 36 callers
Function
UnsafeIO
(t *testing.T, ioa io.IO[A])
stream/common_test.go:30
↓ 33 callers
Function
NewPair
NewPair constructs the pair.
fun/pair.go:10
↓ 33 callers
Function
UnsafeRunSync
UnsafeRunSync runs the given IO[A] synchronously and returns the result.
io/io.go:28
↓ 28 callers
Function
FlatMap
FlatMap converts the result of IO[A] using a function that itself returns an IO[B]. It'll fail if any of IO[A] or IO[B] fail.
io/io.go:111
↓ 26 callers
Function
Pure
Pure[A] constructs an IO[A] from a function that cannot fail.
io/io.go:70
↓ 20 callers
Function
Range
Range starts at `from` and progresses until `to` exclusive.
slice/numbers.go:14
↓ 17 callers
Function
Head
Head returns the first element of the stream. It'll fail if the stream is empty.
stream/execution.go:102
↓ 17 callers
Function
ToSlice
ToSlice executes the stream and collects all results to a slice.
stream/execution.go:74
↓ 15 callers
Function
Lift
Lift returns a stream of one value.
stream/construct.go:29
↓ 15 callers
Function
Map
Map converts values of the stream.
stream/stream.go:105
↓ 15 callers
Function
NewStepResult
NewStepResult constructs StepResult that has one value.
stream/stream.go:27
↓ 14 callers
Function
Fold
Fold performs different calculations based on whether IO[A] failed or succeeded.
io/io.go:162
↓ 14 callers
Function
Map
Map converts all values of a slice using the provided function.
slice/slice.go:14
↓ 14 callers
Function
Take
Take cuts the stream after n elements.
stream/lengthy.go:11
↓ 13 callers
Function
Eval
Eval[A] constructs an IO[A] from a simple function that might fail. If there is panic in the function, it's recovered from and represented as an error
io/io.go:42
↓ 12 callers
Function
NewStepResultEmpty
NewStepResultEmpty constructs an empty StepResult.
stream/stream.go:37
↓ 11 callers
Function
AndThen
AndThen runs the first IO, ignores it's result and then runs the second one.
io/io.go:137
↓ 11 callers
Function
Empty
Empty returns an empty stream.
stream/construct.go:9
↓ 10 callers
Function
FromPureEffect
FromPureEffect constructs IO from the simplest function signature.
io/io.go:53
↓ 9 callers
Function
DrainAll
DrainAll executes the stream and throws away all values.
stream/execution.go:46
↓ 9 callers
Function
Eval
Eval returns a stream of one value that is the result of IO.
stream/construct.go:22
↓ 9 callers
Function
MapEval
MapEval maps the values of the stream. The provided function returns an IO.
stream/stream.go:86
↓ 9 callers
Function
Parallel
Parallel starts the given IOs in Go routines and waits for all results.
io/parallel.go:24
↓ 9 callers
Function
SleepA
SleepA sleeps and then returns the constant value.
io/time.go:18
↓ 9 callers
Function
Some
Some constructs an option with value.
option/option.go:17
↓ 9 callers
Function
StateFlatMapWithFinish
StateFlatMapWithFinish maintains state along the way. When the source stream finishes, it invokes onFinish with the last state.
stream/stream.go:226
↓ 9 callers
Function
UnsafeIO
(t *testing.T, ioa io.IO[A])
io/common_test.go:23
↓ 8 callers
Function
NewResource
NewResource constructs a resource given two functions - acquire and release.
resource/resource.go:49
↓ 8 callers
Function
RecoverToErrorVar
RecoverToErrorVar recovers and places the recovered error into the given variable
fun/errors.go:11
↓ 8 callers
Function
ToSet
ToSet converts a slice to a set.
slice/slice.go:113
↓ 7 callers
Function
BoundedExecutionContext
BoundedExecutionContext creates an execution context that will execute tasks concurrently. Simultaneously there could be as many as size executions. I
io/execution_context.go:70
↓ 7 callers
Function
FanOut
FanOut distributes the same element to all handlers. Stream failure is also distribured to all handlers.
stream/stream.go:444
↓ 7 callers
Function
FlatMap
FlatMap constructs a new stream by concatenating all substreams, produced by f from elements of the original stream.
stream/stream.go:152
↓ 7 callers
Function
Fold
Fold transforms all possible values of OptionA using two provided functions.
option/option.go:34
↓ 7 callers
Function
FromUnit
FromUnit consturcts IO[fun.Unit] from a simple function that might fail.
io/io.go:61
↓ 7 callers
Function
UnsafeIOExpectError
(t *testing.T, expected error, ioa io.IO[A])
stream/common_test.go:36
↓ 7 callers
Function
Use
Use is a only way to access the resource instance. It guarantees that the resource instance will be closed after use regardless of the failure/success
resource/resource.go:26
↓ 6 callers
Method
Close
()
resource/closable_io.go:7
↓ 6 callers
Function
FromChannel
FromChannel constructs a stream that reads from the given channel until the channel is open. When channel is closed, the stream is also closed.
stream/channels.go:50
↓ 6 callers
Function
Nats
Nats return slice []int{1, 2, ..., n}
slice/numbers.go:23
↓ 6 callers
Function
Recover
Recover handles a potential error from IO. It does not fail itself.
io/error_handling.go:28
↓ 6 callers
Function
Sum
Sum sums numbers.
slice/numbers.go:6
↓ 6 callers
Function
Sum
Sum is a pipe that returns a stream of 1 element that is sum of all elements of the original stream.
stream/stream.go:312
↓ 5 callers
Function
AndThenLazy
AndThenLazy appends another stream. The other stream is constructed lazily.
stream/stream.go:130
↓ 5 callers
Function
Contains
Contains creates a predicate that will check if an element is in this set.
set/set.go:7
↓ 5 callers
Function
Delay
Delay[A] wraps a function that will then return an IO.
io/io.go:34
↓ 5 callers
Function
Emit
Emit returns a stream of a single element
stream/construct.go:39
↓ 5 callers
Function
Last
Last keeps track of the current element of the stream and returns it when the stream completes.
stream/execution.go:116
↓ 5 callers
Function
LiftMany
LiftMany returns a stream with all the given values.
stream/construct.go:34
↓ 5 callers
Function
LiftPair
LiftPair[A] constructs an IO from constant values.
io/io.go:17
↓ 5 callers
Function
UnsafeIOExpectError
(t *testing.T, expected error, ioa io.IO[A])
io/common_test.go:29
↓ 5 callers
Function
UnsafeStreamToSlice
(t *testing.T, stm stream.Stream[A])
stream/common_test.go:26
↓ 4 callers
Function
CloseChannel
CloseChannel is an IO that closes the given channel.
io/channels.go:28
↓ 4 callers
Function
FireAndForget
FireAndForget runs the given IO in a go routine and ignores the result It uses Fiber underneath.
io/fiber.go:103
↓ 4 callers
Function
Get
Get is an unsafe function that unwraps the value from the option.
option/option.go:73
↓ 4 callers
Function
Ignore
Ignore throws away the result of IO.
io/io.go:270
↓ 4 callers
Function
MapErr
MapErr maps the result of IO[A] using a function that might fail.
io/io.go:77
↓ 4 callers
Function
MapPipe
MapPipe creates a pipe that maps one stream through the provided function.
stream/stream.go:110
↓ 4 callers
Function
ObtainResult
ObtainResult executes continuation until final result is obtained.
io/continuation.go:25
↓ 4 callers
Function
PairOfChannelsToPipe
PairOfChannelsToPipe - takes two channels that are being used to talk to some external process and convert them into a single pipe. It first starts a
stream/channels.go:68
↓ 4 callers
Function
RetryStrategyMaxCount
RetryStrategyMaxCount is a strategy that retries n times immediately.
io/error_handling.go:75
↓ 4 callers
Function
SetSize
SetSize returns the size of the set.
set/set.go:15
↓ 4 callers
Function
StreamFold
StreamFold performs arbitrary processing of a stream's single step result.
stream/stream.go:55
↓ 4 callers
Function
UnfoldGoResult
UnfoldGoResult converts a stream of GoResults back to normal stream. On the first encounter of Error, the stream fails. default value for `onFailure`
stream/stream.go:192
↓ 3 callers
Function
Async
Async[A] constructs an IO given a function that will eventually call a callback. Internally this function creates a channel and blocks on it until the
io/async.go:8
↓ 3 callers
Method
Close
Closes the fiber and stops sending callbacks. After closing, the respective go routine may complete This is not Cancel, it does not send any signals t
io/fiber.go:23
↓ 3 callers
Function
ConstUnit
ConstUnit creates a function that will ignore it's Unit input and return the specified value.
fun/fun.go:15
↓ 3 callers
Function
Filter
Filter filters slice values.
slice/slice.go:48
↓ 3 callers
Function
Filter
Filter leaves in the stream only the elements that satisfy the given predicate.
stream/stream.go:286
↓ 3 callers
Function
FilterNot
FilterNot filters slice values inverting the condition.
slice/slice.go:59
↓ 3 callers
Function
Finally
Finally runs the finalizer regardless of the success of the IO. In case finalizer fails as well, the second error is printed to log.
io/io.go:251
↓ 3 callers
Function
Flatten
Flatten simplifies a slice of slices to just a slice.
slice/slice.go:95
↓ 3 callers
Function
FoldToGoResult
FoldToGoResult converts either value or error to go result typically it should never fail.
io/error_handling.go:10
↓ 3 callers
Function
ForEach
ForEach runs the given function on the value if it's available.
option/option.go:78
↓ 3 callers
Function
Forall
Forall returns a predicate on slices. The predicate is true if all elements satisfy the given element-wise predicate. It's true for an empty slice.
slice/slice.go:211
↓ 3 callers
Function
HeadTail
HeadTail returns head, tail. panics with ErrHeadOfEmptySlice when slice is empty.
slice/slice.go:309
↓ 3 callers
Function
IsLeft
IsLeft checks whether the provided Either is left or not.
either/either.go:29
↓ 3 callers
Method
Join
Join waits for results of the fiber. When fiber completes, this IO will complete and return the result. After this fiber is closed, all join IOs fail
io/fiber.go:18
↓ 3 callers
Function
MeasureDuration
MeasureDuration captures the wall time that was needed to evaluate the given IO.
io/parallel.go:78
↓ 3 callers
Function
Min
Min - returns the minimum value. See https://go.dev/blog/intro-generics
fun/numbers.go:14
↓ 3 callers
Function
Reverse
Reverse creates a new slice with elements reversed.
slice/slice.go:277
↓ 3 callers
Function
RunSync
RunSync is the same as UnsafeRunSync but returns GoResult[A].
io/goresult.go:25
↓ 3 callers
Method
Send
Send receives readiness signal from `back`. If ready, sends data to `data`.
stream/backpressure_channels.go:73
↓ 3 callers
Function
Sequence
Sequence takes a slice of IOs and returns an IO that will contain a slice of results. It'll fail if any of the internal computations fail.
io/io.go:193
↓ 3 callers
Function
Sliding
Sliding splits the provided slice into windows. Each window will have the given size. The first window starts from offset = 0. Each consecutive window
slice/slice.go:153
↓ 3 callers
Function
ThroughExecutionContext
ThroughExecutionContext runs a stream of tasks through an ExecutionContext. NB! This operation recovers GoResults. This will lead to lost of good elem
stream/pool.go:169
↓ 3 callers
Function
ThroughPipeEval
ThroughPipeEval runs the given stream through pipe that is returned by the provided pipeIO.
stream/pipe.go:23
↓ 3 callers
Function
ToChannel
ToChannel sends all stream elements to the given channel. When stream is completed, channel is closed. The IO blocks until the stream is exhausted. If
stream/channels.go:16
↓ 3 callers
Function
ToStreamEvent
ToStreamEvent converts the given stream to a stream of StreamEvents. Each normal element will become a StreamEvent with data. On a failure or finish a
stream/stream_event.go:27
↓ 3 callers
Function
Unfold
Unfold constructs an infinite stream of values using the production function.
stream/construct.go:66
↓ 2 callers
Function
ClosableMap
ClosableMap is an internal function to map closable using the provided function.
resource/resource.go:66
↓ 2 callers
Function
Collect
Collect runs through the slice, executes the given function and only keeps good returned values.
slice/slice.go:182
↓ 2 callers
Function
ConcatPipes
ConcatPipes connects two pipes into one.
stream/pipe.go:45
↓ 2 callers
Function
Contains
(substring string)
option/option_test.go:23
↓ 2 callers
Function
CreateSleeps
(count int)
io/parallel_test.go:12
↓ 2 callers
Function
Drop
Drop removes initial n elements.
slice/slice.go:272
↓ 2 callers
Function
Drop
Drop skips n elements in the stream.
stream/lengthy.go:29
↓ 2 callers
Function
Filter
Filter leaves the value inside option only if predicate is true.
option/option.go:44
next →
1–100 of 426, ranked by callers