This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires traceur | |
import { iterate, take, map, foldl } from './list-out-of-yield'; | |
// Sum of squares of integers 1..100 | |
var values = take(100, iterate(x => x + 1, 1)); | |
var result = foldl((x, y) => x + y, 0, map(x => x * x, values)); | |
console.log(result); |