functional library

Re-exports functional programming primitives from gmana_functional.

Classes

Either<L, R>
A generic type that represents a value of one of two possible types (a disjoint union).
Failure
Represents a failure in an operation, usually as the Left value of an Either.
GFailure<T, E>
A failed GResult holding an error.
GResult<T, E>
A type representing either a success value T or a failure error E.
GSuccess<T, E>
A successful GResult holding a value.
Left<L, R>
Represents the failure or error side of an Either.
None<T>
Represents an absent value of type T.
NoParams
A class that represents a lack of parameters.
Option<T>
Represents an optional value of type T that may be present (Some) or absent (None).
Reader<R, A>
The Reader<R, A> monad represents a computation that depends on an environment/dependency R and produces A.
A concrete implementation of Either that represents the successful value (Right) in a computation.
Some<T>
Represents a present value of type T.
State<S, A>
The State<S, A> monad represents a computation that passes a state S along with a result A.
StreamUseCase<SuccessType, Params>
A contract for defining streaming use cases.
SyncUseCase<SuccessType, Params>
A contract for use cases that complete synchronously.
Try<T>
The Try<T> monad represents a computation that may result in an exception or a value T.
TryFailure<T>
Failed outcome holding an error Object and StackTrace.
TrySuccess<T>
Successful outcome holding a value T.
Unit
Represents a void-like value in functional programming.
UseCase<SuccessType, Params>
A contract for defining use cases (application business logic) in a clean architecture approach.

Extensions

FutureEitherX on Future<Either<L, R>>
Chains Either operations across an awaited boundary.
GmanaEitherToResultX on Either<L, R>
Extension methods to convert Either into GResult / GResult.
GmanaFutureEitherToResultX on Future<Either<L, R>>
Extension methods to convert asynchronous Future<Either> into Future<GResult>.
GmanaFutureResultToEitherX on Future<GResult<T, E>>
Extension methods to convert asynchronous Future<GResult> into Future<Either>.
GmanaFutureResultX on Future<GResult<T, E>>
Asynchronous composition for a Future that completes with a GResult.
GmanaFutureToResultX on Future<T>
Converts a Future completion into a GResult.
GmanaIterableResultX on Iterable<GResult<T, E>>
Aggregation helpers for collections of GResult values.
GmanaResultToEitherX on GResult<T, E>
Extension methods to convert GResult into Either.
GmanaResultX on GResult<T, E>
Recovery, observation, and asynchronous composition for GResult.
IterableEitherX on Iterable<Either<L, R>>
Batch operations over a collection of Either values.
IterableOptionX on Iterable<Option<T>>
Batch operations over a collection of Option values.
NullableOptionX on T?
Lifts a nullable value into an Option.

Constants

unit → const Unit
A singleton instance representing a unit of work with no meaningful value.

Typedefs

FutureResult<T> = Future<Result<T>>
A future that completes with a fallible Result.
FutureResultUnit = FutureResult<Unit>
A FutureResult for operations that return no meaningful success value.
Result<T> = Either<Failure, T>
A standard fallible result with Failure on the left and T on the right.
ResultUnit = Result<Unit>
A Result for operations that return no meaningful success value.
StreamResult<T> = Stream<Result<T>>
A stream that emits fallible Result values.
StreamResultUnit = StreamResult<Unit>
A StreamResult for streams that emit no meaningful success value.