niknaks.functional

Functional tooling

Members

Classes

OptionalException
class OptionalException

Default exception which is thrown when get() is called on an Optional!(T) which has no value set

Static functions

error
Result!(OkayType, ErrorType) error(ErrorType errorVal)

Constructs a new Result with the status set to error and with the provided value.

ok
Result!(OkayType, ErrorType) ok(OkayType okayVal)

Constructs a new Result with the status set to okay and with the provided value.

Structs

Result
struct Result(Okay, Error)

A result type

Templates

Optional
template Optional(T, onEmptyGet = OptionalException, exceptionArgs...)

Optionals for a given type and with a customizable exception to be thrown when a value is not present and get() is called.

Predicate
template Predicate(T)

Predicate for testing an input type against a condition and returning either true or false

predicateOf
template predicateOf(alias func)

Given the symbol of a function or delegate this will return a new Predicate of it

Meta

Authors

Tristan Brice Velloza Kildaire (deavmi)