Ruby - Functional Patterns in Ruby
Given these Procs:
How do you compose them so that calling the combined Proc with
p1 = Proc.new { |x| x.to_s }
p2 = Proc.new { |s| s + "!" }
p3 = Proc.new { |str| str.reverse }How do you compose them so that calling the combined Proc with
5 returns "5!"?