= Pure
== Summary
Language-level support for automatic parallelism and lazy evaluation.
== Synopsis
require ‘pure’
geometry = Pure.define do
def area(width, height)
width*height
end
def width(border)
7 + border
end
def height(border)
5 + border
end
def border
2
end
end
Compute the area using 3 parallel threads.
puts geometry.compute(3).area
=> 63
We’ve done this computation.
puts((7 + 2)*(5 + 2))
=> 63
== Install
% gem install pure
Or for the (non-gem) .tgz package,
% ruby install.rb [–uninstall]
== Description
Pure imports aspects of the pure functional paradigm into Ruby.
Method and argument names have literal meaning within a Pure.define
block. In the above example, the width argument to area
corresponds, by its literal name, to the width method.
== Links
- Documentation: http://purefunctional.rubyforge.org
- Download: http://rubyforge.org/frs/?group_id=8324
- Rubyforge home: http://rubyforge.org/projects/purefunctional
- Repository: GitHub - quix/pure: Automatic parallelism and lazy evaluation using pure functional programming in Ruby.
== Author
- James M. Lawrence [email protected]