4 public function __construct(){}
5 static function harray($it) {
6 $a = new _hx_array(array());
7 if(null == $it) throw new HException('null iterable');
8 $»it = $it->iterator();
9 while($»it->hasNext()) {
15 static function hlist($it) {
17 if(null == $it) throw new HException('null iterable');
18 $»it = $it->iterator();
19 while($»it->hasNext()) {
25 static function map($it, $f) {
27 if(null == $it) throw new HException('null iterable');
28 $»it = $it->iterator();
29 while($»it->hasNext()) {
31 $l->add(call_user_func_array($f, array($x)));
35 static function mapi($it, $f) {
38 if(null == $it) throw new HException('null iterable');
39 $»it = $it->iterator();
40 while($»it->hasNext()) {
42 $l->add(call_user_func_array($f, array($i++, $x)));
46 static function has($it, $elt, $cmp = null) {
48 if(null == $it) throw new HException('null iterable');
49 $»it = $it->iterator();
50 while($»it->hasNext()) {
57 if(null == $it) throw new HException('null iterable');
58 $»it = $it->iterator();
59 while($»it->hasNext()) {
61 if(call_user_func_array($cmp, array($x, $elt))) {
68 static function exists($it, $f) {
69 if(null == $it) throw new HException('null iterable');
70 $»it = $it->iterator();
71 while($»it->hasNext()) {
73 if(call_user_func_array($f, array($x))) {
79 static function hforeach($it, $f) {
80 if(null == $it) throw new HException('null iterable');
81 $»it = $it->iterator();
82 while($»it->hasNext()) {
84 if(!call_user_func_array($f, array($x))) {
90 static function iter($it, $f) {
91 if(null == $it) throw new HException('null iterable');
92 $»it = $it->iterator();
93 while($»it->hasNext()) {
95 call_user_func_array($f, array($x));
98 static function filter($it, $f) {
100 if(null == $it) throw new HException('null iterable');
101 $»it = $it->iterator();
102 while($»it->hasNext()) {
104 if(call_user_func_array($f, array($x))) {
110 static function fold($it, $f, $first) {
111 if(null == $it) throw new HException('null iterable');
112 $»it = $it->iterator();
113 while($»it->hasNext()) {
115 $first = call_user_func_array($f, array($x, $first));
119 static function count($it, $pred = null) {
122 if(null == $it) throw new HException('null iterable');
123 $»it = $it->iterator();
124 while($»it->hasNext()) {
129 if(null == $it) throw new HException('null iterable');
130 $»it = $it->iterator();
131 while($»it->hasNext()) {
133 if(call_user_func_array($pred, array($x))) {
140 static function hempty($it) {
141 return !$it->iterator()->hasNext();
143 static function indexOf($it, $v) {
145 if(null == $it) throw new HException('null iterable');
146 $»it = $it->iterator();
147 while($»it->hasNext()) {
156 static function concat($a, $b) {
158 if(null == $a) throw new HException('null iterable');
159 $»it = $a->iterator();
160 while($»it->hasNext()) {
164 if(null == $b) throw new HException('null iterable');
165 $»it = $b->iterator();
166 while($»it->hasNext()) {
172 function __toString() { return 'Lambda'; }