From: "marcandre (Marc-Andre Lafortune)" Date: 2012-11-10T02:42:45+09:00 Subject: [ruby-core:49171] [ruby-trunk - Feature #6284] Add composition for procs Issue #6284 has been updated by marcandre (Marc-Andre Lafortune). +1 for #* The symbol used in mathematics for function composition is a circle (���); the arrows are for the definitions of functions (like lambdas) only, so #<- or whatever make no sense to me. Finally, the f ��� g(x) is defined as f(g(x)), so there is no argument there either. ---------------------------------------- Feature #6284: Add composition for procs https://bugs.ruby-lang.org/issues/6284#change-32723 Author: pabloh (Pablo Herrero) Status: Feedback Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: 2.0.0 =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 -- http://bugs.ruby-lang.org/