Eager Functional Lists

This is a simple demonstration of eagerly-evaluated functional linked lists in JavaScript.

When we can build lists using eager cons and map:

var xs = cons(1, cons(2, cons(3, nil())));
var ys = map(squared, xs);
var zs = map(squared, map(squared, xs));

We get lists that evaluate to the following:


Most of the interesting stuff is happening behind the scenes in JavaScript. Check out this page's source to dig into it.