Sha256: a4a645d1a9d7d49e2d580bdf2dbba42865e52eeb4ce53d7e0232c059702d3e94

Contents?: true

Size: 128 Bytes

Versions: 15

Compression:

Stored size: 128 Bytes

Contents

class Array
  # fold from right to left
  def foldr func, init
    reverse_each{ |i| init = func[i, init] }
    init
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
godfat-ludy-0.1.13 lib/ludy/array/foldr.rb
ludy-0.1.15 lib/ludy/array/foldr.rb
ludy-0.1.13 lib/ludy/array/foldr.rb
ludy-0.1.2 lib/ludy/array/foldr.rb
ludy-0.1.1 lib/ludy/array/foldr.rb
ludy-0.1.10 lib/ludy/array/foldr.rb
ludy-0.1.0 lib/ludy/array/foldr.rb
ludy-0.1.11 lib/ludy/array/foldr.rb
ludy-0.1.3 lib/ludy/array/foldr.rb
ludy-0.1.8 lib/ludy/array/foldr.rb
ludy-0.1.4 lib/ludy/array/foldr.rb
ludy-0.1.5 lib/ludy/array/foldr.rb
ludy-0.1.6 lib/ludy/array/foldr.rb
ludy-0.1.9 lib/ludy/array/foldr.rb
ludy-0.1.7 lib/ludy/array/foldr.rb