require 'facets/core/enumerable/elementwise'

module Enumerable

  # Operator equivalent of #elementwise.

  def ~@
    elementwise
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TestOpTildeSelf < Test::Unit::TestCase

    def test_ew
      a = [1,2,3]
      b = [4,5]
      assert_equal( [4,5,6], a.ew + 3 )
      assert_equal( [5,7], a.ew + b )
      assert_equal( [[5,7],[3,4,5]], a.ew.+(b,2) )
      assert_equal( [[5,7],[4,5,6]], a.ew.+(b,3) )
    end

    def test_op_tilde_self
      a = [1,2,3]
      b = [4,5]
      assert_equal( [4,5,6], ~a + 3 )
      assert_equal( [5,7], ~a + b )
      assert_equal( [[5,7],[3,4,5]], (~a).+(b,2) )
      assert_equal( [[5,7],[4,5,6]], (~a).+(b,3) )
    end

  end

=end
