Project

General

Profile

Actions

Feature #9548

closed

Module curry

Added by Anonymous about 10 years ago. Updated about 10 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:60953]

Description

I would like to beg for either Module#curry method with syntax

module Foo
  curry( :sym2, :sym1, 0 => 42, 1 => 43, 3 => 44, foo: "bar" )
end

or curry directive similar to the existing alias directive

module Foo
  curry sym2 sym1( 42, 43, *, 44, foo: "bar )
end

Example usage:

module MyMath
  def power a, b
    a ** b
  end

  curry square power( *, 2 )
  curry square_root power( *, 0.5 )
  curry cube( *, 3 )
  curry pow2 power( 2, * )
  curry pow_e power( Math::E, * )
  curry pow10 power( 10, * )
end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0