FpdartOnIterable<T> extension
Get the first element of the Iterable.
If the Iterable is empty, return None.
Functional programming functions on a mutable dart Iterable using fpdart
.
- on
-
- Iterable<
T>
- Iterable<
Properties
-
firstOption
→ Option<
T> -
Available on Iterable<
Get the first element of the Iterable. If the Iterable is empty, return None.T> , provided by the FpdartOnIterable extensionno setter -
head
→ Option<
T> -
Available on Iterable<
Get the first element of the Iterable. If the Iterable is empty, return None.T> , provided by the FpdartOnIterable extensionno setter -
init
→ Option<
Iterable< T> > -
Available on Iterable<
Return all the elements of a Iterable except the last one. If the Iterable is empty, return None.T> , provided by the FpdartOnIterable extensionno setter -
lastOption
→ Option<
T> -
Available on Iterable<
Get the last element of the Iterable. If the Iterable is empty, return None.T> , provided by the FpdartOnIterable extensionno setter -
tail
→ Option<
Iterable< T> > -
Available on Iterable<
Return all the elements of a Iterable except the first one. If the Iterable is empty, return None.T> , provided by the FpdartOnIterable extensionno setter
Methods
-
all(
bool test(T t)) → bool -
Available on Iterable<
Checks whether every element of this Iterable satisfiesT> , provided by the FpdartOnIterable extensiontest
. -
ap<
B> (Iterable< B Function(T)> iterable) → Iterable<B> -
Available on Iterable<
Apply all the functions insideT> , provided by the FpdartOnIterable extensioniterable
to this Iterable. -
append(
T element) → Iterable< T> -
Available on Iterable<
InsertT> , provided by the FpdartOnIterable extensionelement
at the end of the Iterable. -
breakI(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that do not satisfyT> , provided by the FpdartOnIterable extensiontest
and second element is the remainder of the Iterable. -
concat(
Iterable< T> other) → Iterable<T> -
Available on Iterable<
Creates the lazy concatenation of this Iterable andT> , provided by the FpdartOnIterable extensionother
. -
delete(
T element) → Iterable< T> -
Available on Iterable<
Remove the first occurrence ofT> , provided by the FpdartOnIterable extensionelement
from this Iterable. -
difference(
Eq< T> eq, Iterable<T> other) → Iterable<T> -
Available on Iterable<
Return an Iterable containing the values of this Iterable not included inT> , provided by the FpdartOnIterable extensionother
based oneq
. -
drop(
int n) → Iterable< T> -
Available on Iterable<
Return the suffix of this Iterable after the firstT> , provided by the FpdartOnIterable extensionn
elements. -
dropRight(
[int count = 1]) → Iterable< T> -
Available on Iterable<
Drops the lastT> , provided by the FpdartOnIterable extensioncount
element of this iterable. -
dropWhileLeft(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Remove all elements starting from the first as long asT> , provided by the FpdartOnIterable extensiontest
returnstrue
. -
elem(
T element) → bool -
Available on Iterable<
Check ifT> , provided by the FpdartOnIterable extensionelement
is contained inside this Iterable. -
filter(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Returns the list of those elements that satisfyT> , provided by the FpdartOnIterable extensiontest
. -
filterWithIndex(
bool test(T t, int index)) → Iterable< T> -
Available on Iterable<
Returns the list of those elements that satisfyT> , provided by the FpdartOnIterable extensiontest
. -
flatMap<
B> (Iterable< B> toElements(T t)) → Iterable<B> -
Available on Iterable<
For each element of the Iterable apply functionT> , provided by the FpdartOnIterable extensiontoElements
and flat the result. -
flatMapWithIndex<
B> (Iterable< B> toElements(T t, int index)) → Iterable<B> -
Available on Iterable<
Same asT> , provided by the FpdartOnIterable extensionflatMap
(extend
) but provides also theindex
of each mapped element in the mapping function (toElements
). -
foldLeft<
B> (B initialValue, B combine(B b, T t)) → B -
Available on Iterable<
Fold this Iterable into a single value by aggregating each element of the list from the first to the last.T> , provided by the FpdartOnIterable extension -
foldLeftWithIndex<
B> (B initialValue, B combine(B previousValue, T element, int index)) → B -
Available on Iterable<
Same asT> , provided by the FpdartOnIterable extensionfoldLeft
(fold
) but provides also theindex
of each mapped element in thecombine
function. -
insertBy(
Order< T> order, T element) → Iterable<T> -
Available on Iterable<
InsertT> , provided by the FpdartOnIterable extensionelement
into the list at the first position where it is less than or equal to the next element based onorder
(Order). -
insertWith<
A> (A extract(T instance), Order< A> order, T element) → Iterable<T> -
Available on Iterable<
InsertT> , provided by the FpdartOnIterable extensionelement
into the Iterable at the first position where it is less than or equal to the next element based onorder
(Order). -
intersect(
Iterable< T> iterable) → Iterable<T> -
Available on Iterable<
Return the intersection of two Iterable (all the elements that both Iterable have in common).T> , provided by the FpdartOnIterable extension -
intersperse(
T middle) → Iterable< T> -
Available on Iterable<
Return an Iterable placing anT> , provided by the FpdartOnIterable extensionmiddle
in between elements of the this Iterable. -
lookupEq(
Eq< T> eq, T element) → Option<T> -
Available on Iterable<
Get first element equal toT> , provided by the FpdartOnIterable extensionelement
in this Iterable. -
mapWithIndex<
B> (B toElement(T t, int index)) → Iterable< B> -
Available on Iterable<
Same asT> , provided by the FpdartOnIterable extensionmap
but provides also theindex
of each mapped element in the mapping function (toElement
). -
maximumBy(
Order< T> order) → Option<T> -
Available on Iterable<
The largest element of this Iterable based onT> , provided by the FpdartOnIterable extensionorder
. -
minimumBy(
Order< T> order) → Option<T> -
Available on Iterable<
The least element of this Iterable based onT> , provided by the FpdartOnIterable extensionorder
. -
notElem(
T element) → bool -
Available on Iterable<
Check ifT> , provided by the FpdartOnIterable extensionelement
is not contained inside this Iterable. -
partition(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record containing the values of this Iterable for whichT> , provided by the FpdartOnIterable extensiontest
isfalse
in the first element, and the values for which it istrue
in the second element. -
prepend(
T element) → Iterable< T> -
Available on Iterable<
InsertT> , provided by the FpdartOnIterable extensionelement
at the beginning of the Iterable. -
prependAll(
Iterable< T> other) → Iterable<T> -
Available on Iterable<
Insert all the elements insideT> , provided by the FpdartOnIterable extensionother
at the beginning of the Iterable. -
sortBy(
Order< T> order) → List<T> -
Available on Iterable<
Sort this List based onT> , provided by the FpdartOnIterable extensionorder
(Order). -
sortWith<
A> (A extract(T t), Order< A> order) → List<T> -
Available on Iterable<
Sort this Iterable based onT> , provided by the FpdartOnIterable extensionorder
of an object of typeA
extracted fromT
usingextract
. -
sortWithDate(
DateTime getDate(T instance)) → List< T> -
Available on Iterable<
Sort this Iterable based on DateTime extracted from typeT> , provided by the FpdartOnIterable extensionT
usinggetDate
. -
span(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that satisfyT> , provided by the FpdartOnIterable extensiontest
and second element is the remainder of the Iterable. -
splitAt(
int n) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is an Iterable with the firstT> , provided by the FpdartOnIterable extensionn
elements of this Iterable, and the second element contains the rest of the Iterable. -
takeWhileLeft(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Extract all elements starting from the first as long asT> , provided by the FpdartOnIterable extensiontest
returnstrue
. -
zip<
B> (Iterable< B> iterable) → Iterable<(T, B)> -
Available on Iterable<
T> , provided by the FpdartOnIterable extensionzip
is used to join elements at the same index from two different Iterable into one Iterable of a record. -
zipWith<
B, C> (C combine(T t, B b), Iterable< B> iterable) → Iterable<C> -
Available on Iterable<
Join elements at the same index from two different Iterable into one Iterable containing the result of callingT> , provided by the FpdartOnIterable extensioncombine
on each element pair.