haXe API Documentation
Back |
Indexclass Lambda
Available in flash, neko, js
The Lambda
class is a collection of functional methods in order to
use functional-style programming with haXe.
- static function array<A>(it : Iterable<A>) : Array<A>
-
Creates an
Array
from an Iterable
- static function count<A>(it : Iterable<A>) : Int
-
Count the number of elements in an
Iterable
- static function empty(it : Iterable<Dynamic>) : Bool
-
Tells if an iterable does not contain any element.
- static function exists<A>(it : Iterable<A>, f : A -> Bool) : Bool
-
Tells if at least one element of the iterable if found by using the specific function.
- static function filter<A>(it : Iterable<A>, f : A -> Bool) : List<A>
-
Return the list of elements matching the function 'f'
- static function fold<A, B>(it : Iterable<A>, f : A -> B -> B, first : B) : B
-
Functional 'fold' using an
Iterable
- static function foreach<A>(it : Iterable<A>, f : A -> Bool) : Bool
-
Tells if all elements of the iterable have the specified property defined by
f
.
- static function has<A>(it : Iterable<A>, elt : A, ?cmp : A -> A -> Bool) : Bool
-
Tells if the element is part of an iterable
- static function iter<A>(it : Iterable<A>, f : A -> Void) : Void
-
Call the function 'f' on all elements of the
Iterable
'it'.
- static function list<A>(it : Iterable<A>) : List<A>
-
Creates a
List
from an Iterable
- static function map<A, B>(it : Iterable<A>, f : A -> B) : List<B>
-
Creates a new
Iterable
by appling the function 'f' to all
elements of the iterator 'it'.
- static function mapi<A, B>(it : Iterable<A>, f : Int -> A -> B) : List<B>
-
Similar to
map
, but also pass an index for each item iterated.
Back |
Index