[#69643] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — normalperson@...
Issue #11276 has been updated by Eric Wong.
3 messages
2015/06/17
[#69751] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function. — kubo@...
Issue #11001 has been updated by Takehiro Kubo.
3 messages
2015/06/27
[ruby-core:69817] [Ruby trunk - Feature #6284] Add composition for procs
From:
mudge@...
Date:
2015-06-30 12:39:39 UTC
List:
ruby-core #69817
Issue #6284 has been updated by Paul Mucur.
Pablo Herrero wrote:
> I don't believe you need a pure PF language to benefit from a feature like this. Many ETL projects like transproc (https://github.com/solnic/transproc) would probably find it useful too.
Transproc is what actually inspired me to submit a patch here: my hope is that having functional composition in the Ruby language itself will enable easier data pipelining using only `Proc`s, `Method`s and other objects implementing `call`. The presence of `curry` (http://ruby-doc.org/core-2.2.2/Proc.html#method-i-curry) seems like a good precedent for adding such functional primitives to the core.
----------------------------------------
Feature #6284: Add composition for procs
https://bugs.ruby-lang.org/issues/6284#change-53215
* Author: Pablo Herrero
* Status: Feedback
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
=begin
It would be nice to be able to compose procs like functions in functional programming languages:
to_camel = :capitalize.to_proc
add_header = ->val {"Title: " + val}
format_as_title = add_header << to_camel << :strip
instead of:
format_as_title = lambda {|val| "Title: " + val.strip.capitalize }
It's pretty easy to implement in pure ruby:
class Proc
def << block
proc { |*args| self.call( block.to_proc.call(*args) ) }
end
end
=end
---Files--------------------------------
0002-proc.c-Implement-Method-for-Method-composition.patch (2.71 KB)
0001-proc.c-Implement-Proc-for-Proc-composition.patch (3.73 KB)
0003-proc.c-Support-any-callable-when-composing-Procs.patch (4.01 KB)
--
https://bugs.ruby-lang.org/