select, collect, .... all these methods work like a breadth-first search. With functional, it will work like a depth-first search. It's not faster, but it needs lesser memory.
lib | ||
AUTHORS | ||
LICENSE | ||
Rakefile | ||
README.md | ||
VERSION |
Install
gem install functional
Usage
require 'functional'
obj = 0 .. 10**12
Functional.new( obj).select {|i| i.even? }.collect {|i| i/3 }.select {|i| i.even? }.each &method( :puts)
What's with #map?
Do you know MapReduce? In future #map will be used for MapReduce. Use #collect.