FpdartOnMutableIterable<T> extension

Functional programming functions on a mutable dart Iterable using fpdart.

on

Properties

firstOption Option<T>
Get the first element of the list. If the list is empty, return None.
read-only
Get the first element of the list. If the list is empty, return None.
read-only
init Option<Iterable<T>>
Return all the elements of a list except the last one. If the list is empty, return None.
read-only
lastOption Option<T>
Get the last element of the list. If the list is empty, return None.
read-only
tail Option<Iterable<T>>
Return all the elements of a list except the first one. If the list is empty, return None.
read-only

Methods

all(bool predicate(T t)) bool
Checks whether every element of this Iterable satisfies test.
ap<B>(Iterable<B Function(T t)> fl) Iterable<B>
Apply all the functions inside fl to the Iterable.
append(T t) Iterable<T>
Insert element t at the end of the Iterable.
bind<B>(Iterable<B> f(T t)) Iterable<B>
For each element of the Iterable apply function f and flat the result.
bindWithIndex<B>(Iterable<B> f(T t, int index)) Iterable<B>
For each element of the Iterable apply function f with the index and flat the result.
breakI(bool predicate(T t)) Tuple2<Iterable<T>, Iterable<T>>
Return a Tuple2 where first element is longest prefix (possibly empty) of this Iterable with elements that do not satisfy predicate and second element is the remainder of the Iterable.
concatMap<B>(Iterable<B> f(T t)) Iterable<B>
Apply f to each element of the Iterable and flat the result using concat.
concatMapWithIndex<B>(Iterable<B> f(T t, int index)) Iterable<B>
Apply f to each element of the Iterable using the index and flat the result using concat.
delete(T element) Iterable<T>
Remove the first occurrence of element from this Iterable.
drop(int n) Iterable<T>
Return the suffix of this Iterable after the first n elements.
dropWhileLeft(bool predicate(T t)) Iterable<T>
Remove all elements starting from the first as long as predicate returns true.
dropWhileRight(bool predicate(T t)) Iterable<T>
Remove all elements starting from the last as long as predicate returns true.
elem(T element) bool
Check if element is contained inside this Iterable.
filter(bool predicate(T t)) Iterable<T>
Returns the list of those elements that satisfy predicate.
flatMap<B>(Iterable<B> f(T t)) Iterable<B>
For each element of the Iterable apply function f and flat the result.
flatMapWithIndex<B>(Iterable<B> f(T t, int index)) Iterable<B>
For each element of the Iterable apply function f with the index and flat the result.
foldLeft<B>(B initialValue, B f(B b, T t)) → B
Fold a List into a single value by aggregating each element of the list from the first to the last.
foldLeftWithIndex<B>(B initialValue, B f(B accumulator, T element, int index)) → B
Fold a List into a single value by aggregating each element of the list from the first to the last using their index.
foldRight<B>(B initialValue, B f(T element, B accumulator)) → B
Fold a List into a single value by aggregating each element of the list from the last to the first.
foldRightWithIndex<B>(B initialValue, B f(T element, B accumulator, int index)) → B
Fold a List into a single value by aggregating each element of the list from the last to the first using their index.
insertBy(Order<T> order, T element) Iterable<T>
Insert element into the list at the first position where it is less than or equal to the next element based on order.
insertWith<A>(A insert(T instance), Order<A> order, T element) Iterable<T>
Insert element into the list at the first position where it is less than or equal to the next element based on order of an object of type A extracted from element using insert.
intersect(Iterable<T> l) Iterable<T>
Return the intersection of two Iterable (all the elements that both Iterable have in common).
mapWithIndex<B>(B f(T t, int index)) Iterable<B>
Map Iterable from type T to type B using the index.
maximumBy(Order<T> order) Option<T>
The largest element of this Iterable based on order.
minimumBy(Order<T> order) Option<T>
The least element of this Iterable based on order.
notElem(T element) bool
Check if element is not contained inside this Iterable.
partition(bool f(T t)) Tuple2<Iterable<T>, Iterable<T>>
Return a Tuple2 where the first element is an Iterable with all the elements of this Iterable that do not satisfy f and the second all the elements that do satisfy f.
plus(Iterable<T> l) Iterable<T>
Append l to this Iterable.
prepend(T t) Iterable<T>
Insert element t at the beginning of the Iterable.
sortBy(Order<T> order) Iterable<T>
Sort this Iterable based on order.
sortWith<A>(A sort(T instance), Order<A> order) Iterable<T>
Sort this Iterable based on order of an object of type A extracted from T using sort.
sortWithDate(DateTime getDate(T instance)) Iterable<T>
Sort Iterable based on DateTime extracted from type T using getDate.
span(bool predicate(T t)) Tuple2<Iterable<T>, Iterable<T>>
Return a Tuple2 where first element is longest prefix (possibly empty) of this Iterable with elements that satisfy predicate and second element is the remainder of the Iterable.
splitAt(int n) Tuple2<Iterable<T>, Iterable<T>>
Return a Tuple2 where first element is an Iterable with the first n elements of this Iterable, and the second element contains the rest of the Iterable.
takeWhileLeft(bool predicate(T t)) Iterable<T>
Extract all elements starting from the first as long as predicate returns true.
takeWhileRight(bool predicate(T t)) Iterable<T>
Extract all elements starting from the last as long as predicate returns true.
zip<B>(Iterable<B> lb) Iterable<Tuple2<T, B>>
zip is used to join elements at the same index from two different List into one List of Tuple2.
zipWith<B, C>(C Function(B b) f(T t)) Iterable<C> Function(Iterable<B> lb)
Join elements at the same index from two different List into one List containing the result of calling f on the elements pair.