Lines Matching defs:fold
74 function fold(cons, seed, iter) {
168 assertEquals(45, fold(sum, 0, integers_until(10)));
170 assertEquals([1, 2, 3], fold(append, [], values(1, 2, 3)));
172 assertEquals(45, fold(sum, 0, take(integers_from(0), 10)));
174 assertEquals(90, fold(sum, 0, take(skip_every(integers_from(0), 2), 10)));
184 fold(append, [],
196 fold(append, [],
200 fold(append, [],
207 assertEquals(0, fold(sum, 0, unreachable(null)));
208 assertEquals(0, fold(sum, 0, unreachable(undefined)));
211 assertThrows('fold(sum, 0, unreachable({}))', TypeError);
212 assertThrows('fold(sum, 0, unreachable("foo"))', TypeError);
213 assertThrows('fold(sum, 0, unreachable(37))', TypeError);
216 assertThrows('fold(sum, 0, remove_next_after(integers_until(10), 5))',
220 fold(sum, 0, remove_next_after(integers_until(10), 10)));
223 fold(sum, 0, poison_next_after(integers_until(10), 10)));
307 fold(append, [],
327 assertEquals(45, fold(sum, 0, poison_proxy_after(integers_until(10), 10)));