Reader<R, A> class final

Reader<R, A> allows to read values A from a dependency/context R without explicitly passing the dependency between multiple nested function calls.

Inheritance
Mixed in types

Constructors

Reader(A _read(R r))
Build a Reader given A Function(R).
const
Reader.flatten(Reader<R, Reader<R, A>> reader)
Flat a Reader contained inside another Reader to be a single Reader.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

andThen<C>(covariant Reader<R, C> then()) Reader<R, C>
Chain the result of then to this Reader.
override
ap<C>(covariant Reader<R, C Function(A a)> a) Reader<R, C>
Apply the function contained inside a to change the value of type A to a value of type B.
override
ask() Reader<R, R>
Read the current dependency R.
asks(A f(R r)) Reader<R, A>
Change reading function to f given context/dependency R.
call<C>(covariant Reader<R, C> chain) Reader<R, C>
Chain multiple functions having the reader R.
override
chainFirst<C>(covariant Reader<R, C> chain(A a)) Reader<R, A>
Chain a request that returns another Reader, execute it, ignore the result, and return the same value as the current Reader.
override
compose<C>(Reader<R, C> reader) Reader<R, C>
Compose the dependency R of this Reader to reader.
flatMap<C>(covariant Reader<R, C> f(A a)) Reader<R, C>
Used to chain multiple functions that return a Reader.
override
local<R1>(R f(R1 context)) Reader<R1, A>
Change dependency type of Reader<R, A> from R to R1 after calling run.
map<C>(C f(A a)) Reader<R, C>
Change the value of type A to a value of type C using function f.
override
map2<C, D>(covariant Reader<R, C> m1, D f(A a, C c)) Reader<R, D>
Change type of this Reader based on its value of type A and the value of type C of another Reader.
override
map3<C, D, E>(covariant Reader<R, C> m1, covariant Reader<R, D> m2, E f(A a, C c, D d)) Reader<R, E>
Change type of this Reader based on its value of type A, the value of type C of a second Reader, and the value of type D of a third Reader.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pure<C>(C c) Reader<R, C>
Return a Reader containing the value c.
override
run(R r) → A
Provide the value R (dependency) and extract result A.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override