require 'rubygems' require 'active_support' class Symbol def >> (other) [self, other] end def *(other) other >> self end end class Array def >> (other) [self, other] end def *(other) other >> self end def to_proc lambda do |*args| inject(args.shift) do |recv, p| p.to_proc.call(recv, *args) end end end end class Module def compose(name, &op) define_method name do op.call(self) end end end