A collection of lazy and persistent data structures and mixins for Ruby that provide support for a more functional programming style.
Lazy evaluation is a technique in which computations are deferred until their results are first used (which may be never). Pazy provides lazy (cached) attributes as well as an extension of the enumerable module that defers the execution of list manipulation methods until particular values are accessed.
Persistent data structures are immutable data structures with shared information between instances. Any modification operation on such a structure will create a new instance while leaving the original one intact. This eliminates the need for manipulating data in place while at the same time avoiding the high cost of copying the complete structure.
Portions of this code were ported from the Clojure runtime system.
Author: Olaf Delgado-Friedrichs (odf@github.com)
Copyright © 2011 The Australian National University