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
↓ 2 callers
Function
FlatMap
FlatMap converts all values of a slice using the provided function. As the function returns slices, all of them are appended to a single long slice.
slice/slice.go:24
↓ 2 callers
Function
Flatten
Flatten simplifies option of option to just Option[A].
option/option.go:68
↓ 2 callers
Function
Fold
Fold pattern matches Either with two given pattern match handlers
either/either.go:39
↓ 2 callers
Function
FoldLeft
FoldLeft aggregates stream in a more simple way than StateFlatMap.
stream/stream.go:486
↓ 2 callers
Function
FoldToGoResult
FoldToGoResult converts a stream into a stream of go results. All go results will be non-error except probably the last one.
stream/stream.go:170
↓ 2 callers
Function
ForEach
ForEach calls the provided callback after IO is completed.
io/io.go:242
↓ 2 callers
Function
FromChannel
FromChannel reads a single value from the channel
io/channels.go:42
↓ 2 callers
Function
FromStepResult
FromStepResult constructs a stream from an IO that returns StepResult.
stream/construct.go:80
↓ 2 callers
Function
GetLeft
GetLeft returns left if it's defined.
either/either.go:48
↓ 2 callers
Function
GroupBy
GroupBy groups elements by a function that returns a key.
slice/slice.go:122
↓ 2 callers
Function
GroupByEval
GroupByEval collects group by a user-provided key (which is evaluated as IO). Whenever a new key is encountered, the previous group is emitted. When t
stream/stream.go:378
↓ 2 callers
Function
IndexOf
IndexOf returns the index of the first occurrence of a in the slice or -1 if not found.
slice/slice.go:257
↓ 2 callers
Function
IsEmpty
IsEmpty checks whether the option is empty.
option/option.go:90
↓ 2 callers
Function
IsEqualTo
IsEqualTo compares two arguments for equality.
fun/predicate.go:7
↓ 2 callers
Function
Map
Map applies a function to the value inside option if any.
option/option.go:24
↓ 2 callers
Function
MapToStrings
MapToStrings converts stream of bytes to strings.
text/read.go:90
↓ 2 callers
Function
Memoize
Memoize returns a function that will remember the original function in a map. It's thread safe, however, not super performant.
fun/memoize.go:7
↓ 2 callers
Function
NewStreamEvent
(value A)
stream/stream_event.go:12
↓ 2 callers
Function
Notify
Notify starts a separate thread that will call the given callback after the specified time.
io/time.go:44
↓ 2 callers
Function
PairBoth
PairBoth returns both parts of the pair.
fun/pair.go:19
↓ 2 callers
Function
PairSequentially
PairSequentially runs two IOs sequentially and returns both results.
io/parallel.go:52
↓ 2 callers
Function
ReadByteChunks
ReadByteChunks reads chunks from the reader.
text/read.go:16
↓ 2 callers
Function
ReadLines
ReadLines reads text file line-by-line. If there is a last line that is not terminated by '\n', it is ignored.
text/read.go:98
↓ 2 callers
Function
RecoverToLog
RecoverToLog in case of error just logs it.
fun/errors.go:30
↓ 2 callers
Function
Repeat
Repeat appends the same stream infinitely.
stream/lengthy.go:6
↓ 2 callers
Function
Retry
Retry performs the same operation a few times based on the retry strategy.
io/error_handling.go:40
↓ 2 callers
Function
RetryS
RetryS performs the same operation a few times based on the retry strategy. Also returns the last state of the error-handling strategy.
io/error_handling.go:57
↓ 2 callers
Function
Sleep
Sleep makes the IO sleep the specified time.
io/time.go:11
↓ 2 callers
Function
SplitBySeparator
SplitBySeparator splits byte-chunk stream by the given separator.
text/read.go:38
↓ 2 callers
Function
Start
Start will start the IO in a separate go-routine (actually in the global unbounded execution context). It'll establish a channel with callbacks, so th
io/fiber.go:97
↓ 2 callers
Function
StateFlatMapWithFinishAndFailureHandling
StateFlatMapWithFinishAndFailureHandling maintains state along the way. When the source stream finishes, it invokes onFinish with the last state. If t
stream/stream.go:254
↓ 2 callers
Function
ThroughExecutionContextUnordered
ThroughExecutionContextUnordered runs a stream of tasks through an ExecutionContext. The order of results is not preserved! This operation recovers Go
stream/pool.go:179
↓ 2 callers
Function
ToChannel
ToChannel saves the value to the channel
io/channels.go:10
↓ 2 callers
Function
ToChannels
ToChannels sends each stream element to every given channel. Failure or completion of the stream leads to closure of all channels. TODO: Send failure
stream/channels.go:29
↓ 2 callers
Function
UnfoldGoResult
UnfoldGoResult represents GoResult back to ordinary IO.
io/error_handling.go:23
↓ 2 callers
Function
Wrapf
Wrapf wraps an error with additional context information
io/io.go:229
↓ 2 callers
Function
ZipWithIndex
ZipWithIndex prepends the index to each element.
slice/slice.go:247
↓ 2 callers
Method
closeOutputIfNeeded
()
stream/pool.go:96
↓ 1 callers
Function
AddSeparatorAfterEachElement
AddSeparatorAfterEachElement adds a separator after each stream element
stream/mangling.go:4
↓ 1 callers
Function
AfterTimeout
AfterTimeout sleeps the given time and then starts the other IO.
io/time.go:62
↓ 1 callers
Function
AndThen
AndThen appends another stream after the end of the first one.
stream/stream.go:125
↓ 1 callers
Function
AppendAll
AppendAll concatenates all slices.
slice/slice.go:108
↓ 1 callers
Function
AppendToSlice
AppendToSlice executes the stream and appends it's results to the slice.
stream/execution.go:59
↓ 1 callers
Method
Both
Pair.Both returns both parts of the pair.
fun/pair.go:24
↓ 1 callers
Function
BoundedExecutionContextResource
BoundedExecutionContextResource returns a resource that is a bounded execution context.
resource/closable_io.go:17
↓ 1 callers
Function
CastAsInterface
CastAsInterface casts a value of an arbitrary type as interface {}.
fun/cast.go:6
↓ 1 callers
Function
ClosableFlatMap
ClosableFlatMap flatmaps the closable. Allows to construct have more than one resource in scope.
resource/resource.go:74
↓ 1 callers
Function
ClosableIOTransform
ClosableIOTransform transforms a closable of io closable to just io closable.
resource/resource.go:110
↓ 1 callers
Method
CloseReceiverNormally
()
stream/backpressure_channels.go:105
↓ 1 callers
Method
CloseReceiverWithError
(err error)
stream/backpressure_channels.go:100
↓ 1 callers
Function
Collect
Collect collects all element from the stream and for each element invokes the provided function
stream/execution.go:18
↓ 1 callers
Function
ConcurrentlyFirst
ConcurrentlyFirst - runs all IOs in parallel. returns the very first result. TODO: after obtaining result - cancel the other IOs.
io/parallel.go:31
↓ 1 callers
Function
Count
Count counts the number of elements that satisfy the given predicate.
slice/slice.go:84
↓ 1 callers
Function
CreateSleeps
(count int)
resource/bounded_ec_test.go:13
↓ 1 callers
Function
Curry
Curry takes a function that has two arguments and returns a function with two argument lists.
fun/fun.go:29
↓ 1 callers
Function
DropWhile
DropWhile removes the beginning of the stream so that the new stream starts with an element that falsifies the predicate.
stream/lengthy.go:59
↓ 1 callers
Function
EmitMany
EmitMany returns a stream with all the given values.
stream/construct.go:44
↓ 1 callers
Function
Exists
Exists returns a predicate on slices. The predicate is true if there is an element that satisfy the given element-wise predicate. It's false for an em
slice/slice.go:195
↓ 1 callers
Function
FilterNot
Filter leaves in the stream only the elements that do not satisfy the given predicate.
stream/stream.go:305
↓ 1 callers
Function
FlatMap
FlatMap allows to add another resource to scope. Both will be released in reverse order.
resource/resource.go:101
↓ 1 callers
Function
FlatMap
FlatMap converts an internal value if it is present using the provided function.
option/option.go:58
↓ 1 callers
Function
FlatMapPipe
FlatMapPipe creates a pipe that flatmaps one stream through the provided function.
stream/stream.go:207
↓ 1 callers
Function
FoldLeft
FoldLeft folds all values in the slice using the combination function.
slice/slice.go:33
↓ 1 callers
Function
FoldLeftEval
FoldLeftEval aggregates stream in a more simple way than StateFlatMap. It takes `zero` as the initial accumulator value and then combines one element
stream/stream.go:470
↓ 1 callers
Function
ForEach
ForEach executes the given function for each element of the slice.
slice/slice.go:225
↓ 1 callers
Function
ForEach
ForEach invokes a simple function for each element of the stream.
stream/execution.go:38
↓ 1 callers
Function
FromBackpressureChannel
FromBackpressureChannel forms a stream[A] that will be consumed by `f`. The result of `f` will be used to report back failures and finish signals. thi
stream/backpressure_channels.go:218
↓ 1 callers
Function
FromClosableIO
FromClosableIO constructs a new resource from some value that itself supports method Close.
resource/closable_io.go:12
↓ 1 callers
Function
FromConstantGoResult
FromConstantGoResult converts an existing GoResult value into a fake IO. NB! This is not for normal delayed IO execution!
io/goresult.go:32
↓ 1 callers
Function
FromSlice
FromSlice constructs a stream from the slice.
stream/construct.go:49
↓ 1 callers
Function
Generate
Generate constructs an infinite stream of values using the production function.
stream/construct.go:58
↓ 1 callers
Function
GetRight
GetRight returns left if it's defined.
either/either.go:57
↓ 1 callers
Function
GroupBy
GroupBy collects group by a user-provided key. Whenever a new key is encountered, the previous group is emitted. When the original stream finishes, th
stream/stream.go:336
↓ 1 callers
Function
GroupByMap
GroupByMap is a convenience function that groups and then maps the subslices.
slice/slice.go:138
↓ 1 callers
Function
GroupByMapCount
GroupByMapCount for each key counts how often it is seen.
slice/slice.go:144
↓ 1 callers
Function
Grouped
Grouped partitions the slice into groups of the given size. Last partition might be smaller.
slice/slice.go:170
↓ 1 callers
Method
HappyPathReceive
HappyPathReceive forms a stream of a happy path.
stream/backpressure_channels.go:121
↓ 1 callers
Function
Head
Head returns head of the slice. panics with ErrHeadOfEmptySlice when slice is empty.
slice/slice.go:320
↓ 1 callers
Function
HeadAndTail
HeadAndTail returns the very first element of the stream and the rest of the stream.
stream/execution.go:83
↓ 1 callers
Function
IOFuncToGoResult
IOFuncToGoResult converts a function that returns IO to a function that will return GoResult.
io/goresult.go:38
↓ 1 callers
Function
Identity
Identity function returns the given value unchanged.
fun/fun.go:38
↓ 1 callers
Function
Intersection
Intersection leaves only elements that are both in as and as2.
slice/slice.go:293
↓ 1 callers
Function
IsDefined
IsDefined checks whether the option contains a value.
option/option.go:85
↓ 1 callers
Function
JoinFiberAsGoResult
JoinFiberAsGoResult joins the fiber synchronously and returns GoResult.
io/fiber.go:129
↓ 1 callers
Function
JoinWithTimeout
JoinWithTimeout joins the given fiber and waits no more than the given duration.
io/fiber.go:134
↓ 1 callers
Function
Keys
Keys returns keys of the map.
maps/maps.go:4
↓ 1 callers
Function
Len
Len is a pipe that returns a stream of 1 element that is the count of elements of the original stream.
stream/stream.go:324
↓ 1 callers
Function
LiftFunc
LiftFunc wraps the result of function into IO.
io/io.go:149
↓ 1 callers
Function
Map
Map maps the resource value using the provided conversion function.
resource/resource.go:93
↓ 1 callers
Function
MapConst
MapConst ignores the result and replaces it with the given constant.
io/io.go:105
↓ 1 callers
Function
MapKeys
MapKeys converts original keys to new keys.
maps/maps.go:30
↓ 1 callers
Function
MapSlice
MapSlice converts each element of the slice inside IO[[]A] using the provided function that cannot fail.
io/io_slice.go:6
↓ 1 callers
Function
MapStringToBytes
MapStringToBytes converts stream of strings to stream of byte chunks.
text/write.go:31
↓ 1 callers
Function
MapValues
MapValues converts values in the map using the provided function.
maps/maps.go:44
↓ 1 callers
Function
Max
Max - returns the maximum value. See https://go.dev/blog/intro-generics
fun/numbers.go:23
↓ 1 callers
Function
Memoize
Memoize returns a function that will remember the original function in a map. It's thread safe, however, not super performant.
io/memoize.go:9
↓ 1 callers
Function
Merge
Merge combines two maps. Function `combine` is invoked when the same key is available in both maps.
maps/maps.go:13
↓ 1 callers
Function
Nats
(count int)
io/common_test.go:36
↓ 1 callers
Function
Nats
Nats returns an infinite stream of ints starting from 1.
stream/construct.go:85
↓ 1 callers
Function
NewGoResult
NewGoResult constructs a GoResult.
io/goresult.go:11
← previous
next →
101–200 of 426, ranked by callers