Implementing Infinite Data Structure in
JavaScript.
11/26 ¶
naturalSequence().filter(limit(n)).reduce(sum)
sum(a, b) := a + b
limit(n)(a) := (n >= a)
.reduce(f(a, b)) := f(seq[:last-1].reduce(f), seq[last])
filter(f(a)) := for each a in seq, sequence of a which f(a) is true.