0.0
No commit activity in last 3 years
No release in over 3 years
Array#zip_with inspired by Haskell's zipWith function.It takes either yields a zipped array to a block or reduces the zipped array with the given operator.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 12.3
~> 3.7
~> 0.51.0
~> 0.9.12
 Project Readme

Gem Version Build Status License

Array#zip_with

Array#zip_with method inspired by Haskell's zipWith function.

Installation

Add this line to your application's Gemfile:

gem 'array_zip_with'

And then execute:

$ bundle

Or install it yourself as:

$ gem install array_zip_with

Usage

With block

a = [1, 2, 3]
a.zip_with([3, 2, 1]) { |x, y| x + y } # => [4, 4, 4]

With symbol

a = [1, 2, 3]
a.zip_with([3, 2, 1], :+) # => [4, 4, 4]

License

The gem is available as open source under the terms of the MIT License.