Types

Eachable1

Eachable which each() calls the callback with one argument

Parent types

Direct children types

Methods

any(e:Eachable1, predicate:Any)
Check whether there is any element in arr that satisfies the given predicate. TODO: Make it work on anything with Eachable2 too.
Arr(r:Eachable1)
Convert range to an array
drop_while(something:Eachable1, predicate:Any)
EXPERIMENTAL! Do not use!
filter(something:Eachable1, predicate:Any)
Filter something to an Arr (array) of values using predicate.
filter(something:Eachable1)
Filter nulls out. DEPRECATED, USE something.without(null) INSTEAD.
first(e:Eachable1, predicate:Any)
Find first element in e that satisfies the predicate.
first(e:Eachable1)
Find first element in e that satisfies Bool(e) == true. Exactly same as first(e, identity).
get(e:Eachable1, attr:Str)
Return array made of given attribute of each element of given Eachable1 where present
get(e:Eachable1, attr:Str, dflt:Any)
Return array made of given attribute of each element of given Eachable1 where present or default value where the attribute is not present Return array (? depends on map() ?) made of given attribute of each element of given Eachable1
none(e:Eachable1, predicate:Fun)
Check that there is no element in e that satisfies the given predicate. Exactly same as not(any(e, predicate)) .
reduce(something:Eachable1, start:Any, f:Fun)
Combine items to a single value using the supplied binary function First f is applied to start and the first element of something then on each step f is applied to previous result and next element of something.
replace(something:Eachable1, src:Any, dst:Any)
Replace all occurrences of src with dst
take_while(something:Eachable1, predicate:Any)
EXPERIMENTAL! Do not use!
the_one(something:Eachable1, predicate:Any)
Find the only element that satisfies the predicate. Throws TheOneFail exception if there are no elements that satisfy the predicate or if there is more than one element that satisfies the predicate.
the_one(something:Eachable1, predicate:Any, body:Fun, found_more:Fun=(a function), found_none:Fun=(a function))
Find the only element that satisfies the predicate and execute given code with the value
the_one(something:Eachable1)
Extract the only element. Throws TheOneFail exception if there are no elements or if there is more than one element.