# Functions
All returns true when the supplied predicate evaluates to true for all of the values in the slice.
AndThen is an alias for FlatMap.
Any returns true when the supplied predicate evaluates to true for any of the values in the slice.
CollectOptions collects a list of Options into a single Option of the list of Some values in it.
CollectResults collects a list of Results into a single Result of the list of Ok values in it.
Comp is left to right function composition.
Const is a function that accepts an argument and returns a function that always returns that value irrespective of the returned function's argument.
CopyAll creates a new slice where each item of the slice is a deep copy of the elements of the input slice.
CopyAllErr creates a new slice where each item of the slice is a deep copy of the elements of the input slice.
Elem returns true if the element in the argument is found in the slice.
ElimEither is the universal Either eliminator.
ElimOption is the universal Option eliminator.
Eq is a curried function that returns true if its eventual two arguments are equal.
Err creates a new Result with an error.
Errf creates a new Result with a new formatted error string.
Filter creates a new slice of values where all the members of the returned slice pass the predicate that is supplied in the argument.
FilterMap takes a function argument that optionally produces a value and returns a slice of the 'Some' return values.
Find returns the first value that passes the supplied predicate, or None if the value wasn't found.
FindIdx returns the first value that passes the supplied predicate along with its index in the slice.
FlatMapOption transforms a function A -> Option[B] into one that accepts an Option[A] as an argument.
FlatMapResult applies a function that returns a Result[B] to the success value if it exists.
Flatten takes a slice of slices and returns a concatenation of those slices.
FlattenOption joins multiple layers of Options together such that if any of the layers is None, then the joined value is None.
FlattenResult takes a nested Result and joins the two functor layers into one.
Foldl iterates through all members of the slice left to right and reduces them pairwise with an accumulator value that is seeded with the seed value in the argument.
Foldr, is exactly like Foldl except that it iterates over the slice from right to left.
ForEachConc maps the argument function over the slice, spawning a new goroutine for each element in the slice and then awaits all results before returning them.
GuardTest implements a test level timeout.
HasDuplicates checks if the given slice contains any duplicate elements.
Head returns the first element of the slice, assuming it is non-empty.
Iden is the left and right identity of Comp.
Init returns the slice without the last element, assuming the slice is not empty.
KeySet converts a map into a Set containing the keys of the map.
Last returns the last element of the slice, assuming it is non-empty.
Len is the len function that is defined in a way that makes it usable in higher-order contexts.
LiftA2Option transforms a pure function (A, B) -> C into one that will operate in an Option context.
LiftA2Result lifts a two-argument function to a function that can operate over results of its arguments.
Map applies the function argument to all members of the slice and returns a slice of those return values.
MapFirst lifts the argument function into one that applies to the first element of a 2-tuple.
MapLeft maps the left value of the Either to a new value.
MapOk applies a non-endomorphic function to the success value if it exists and returns a Result of the new type.
MapOption transforms a pure function A -> B into one that will operate inside the Option context.
MapOptionZ transforms a pure function A -> B into one that will operate inside the Option context.
MapRight maps the right value of the Either to a new value.
MapSecond lifts the argument function into one that applies to the second element of a 2-tuple.
Neq is a curried function that returns true if its eventual two arguments are not equal.
NewConcurrentQueue constructs a ConcurrentQueue.
NewContextGuard constructs and returns a new instance of ContextGuard.
NewEventDistributor creates a new event distributor of the declared type.
NewEventReceiver creates a new event receiver with concurrent queues of the given size.
NewGoroutineManager constructs and returns a new instance of GoroutineManager.
NewLeft returns an Either with a left value.
New returns an initialized List.
NewQueue creates a new Queue.
NewReq is the base constructor of the Req type.
NewResult creates a new result from a (value, error) tuple.
NewRight returns an Either with a right value.
NewSet returns a new set with the given elements.
NewSubMap creates a sub-map from a given map using specified keys.
NewSubMapIntersect returns a sub-map of `m` containing only the keys found in both `m` and the `keys` slice.
NewT2 is the canonical constructor for a T2.
None trivially constructs an empty option
None : Option[A].
Ok creates a new Result with a success value.
OptionFromPtr constructs an option from a pointer.
Pair takes two functions that share the same argument type and runs them both and produces a 2-tuple of the results.
PredAnd is a lifted version of the && operation that operates over functions producing a boolean value from some type A.
PredOr is a lifted version of the || operation that operates over functions producing a boolean value from some type A.
RecvOrTimeout attempts to recv over chan c, returning the value.
RecvResp takes three channels: a response channel, an error channel and a quit channel.
Replicate generates a slice of values initialized by the prototype value.
SendOrQuit attempts to and a message through channel c.
SetDiff returns all the items that are in the first set but not in the second.
SliceToMap converts a slice to a map using the provided key and value functions.
Some trivially injects a value into an optional context.
SomeToLeft can be used to convert an Option value into an Either, by providing the Right value that should be used if the Option value is None.
SomeToRight can be used to convert an Option value into an Either, by providing the Left value that should be used if the Option value is None.
Span, applied to a predicate and a slice, returns two slices where the first element is the longest prefix (possibly empty) of slice elements that satisfy the predicate and second element is the remainder of the slice.
SplitAt(n, s) returns a tuple where first element is s prefix of length n and second element is the remainder of the list.
Sum calculates the sum of a slice of numbers, `items`.
Tail returns the slice without the first element, assuming the slice is not empty.
TransposeOptRes transposes the Option[Result[A]] into a Result[Option[A]].
TransposeResOpt transposes the Result[Option[A]] into a Option[Result[A]].
TraverseOption traverses a slice of A values, applying the provided function to each, collecting the results into an Option of a slice of B values.
TraverseResult traverses a slice of A values, applying the provided function to each, collecting the results into a Result of a slice of B values.
TrimNones takes a slice of Option values and returns a slice of the Some values in it.
Uncons splits a slice into a pair of its Head and Tail.
Unsnoc splits a slice into a pair of its Init and Last.
WithBlockingCG is used to create a cancellable context that will NOT be cancelled if the main quit signal is triggered, to block shutdown of important tasks.
WithCustomTimeoutCG is used to create a cancellable context with a custom timeout.
WithGuardTimeout sets timeout for the guard.
WithTimeoutCG is used to create a cancellable context with a default timeout.
WriteFile synchronously writes data to the named file.
WriteFileRemove synchronously writes data to the named file.
ZipWith combines slice elements with the same index using the function argument, returning a slice of the results.
# Constants
DefaultQueueSize is the default size to use for concurrent queues.
# Variables
DefaultTimeout is the default timeout used for context operations.
# Structs
ConcurrentQueue is a typed concurrent-safe FIFO queue with unbounded capacity.
ContextGuard is a struct that provides a wait group and main quit channel that can be used to create guarded contexts.
Either is a type that can be either left or right.
EventDistributor is a struct type that helps to distribute events to multiple subscribers.
EventReceiver is a struct type that holds two queues for new and removed items respectively.
GoroutineManager is used to launch goroutines until context expires or the manager is stopped.
GuardConfig stores options for Guard function.
List represents a doubly linked list.
Option represents a value which may or may not be there.
Queue is a generic queue implementation.
Req is a type to encapsulate RPC-like calls wherein we send some data structure as a request, as well as a channel to receive the response on where the remote goroutine will send the result.
Result represents a value that can either be a success (T) or an error.
T2 is the simplest 2-tuple type.
Unit is a type alias for the empty struct to make it a bit less noisy to communicate the informationaless type.
# Interfaces
Copyable is a generic interface for a type that's able to return a deep copy of itself.
CopyableErr is a generic interface for a type that's able to return a deep copy of itself.
Event is a generic event that can be sent to a subscriber.
EventPublisher is an interface type for a component that offers event based subscriptions for publishing events.
Number is a type constraint for all numeric types in Go (integers, float and complex numbers).
# Type aliases
ContextGuardOption defines the signature of a functional option that can be used to configure the behaviour of the context derived via the WithCtx method of the ContextGuard.
GuardOption is an option for Guard function.
Pred[A] is a type alias for a predicate operating over type A.
Set is a generic set using type params that supports the following operations: diff, union, intersection, and subset.