Skip to content

Instantly share code, notes, and snippets.

View dchelimsky's full-sized avatar

David Chelimsky dchelimsky

  • Retired
  • Chicago, IL, USA
View GitHub Profile
@dchelimsky
dchelimsky / composer.rb
Last active December 24, 2015 13:49
Prototype higher order function to compose lambdas in Ruby. Result of working with Matt Wynne on a means of wrapping filters in Cucumber (Ruby).
require 'wrong/adapters/rspec'
# (apply comp fns) in clojure
module Composer
def compose((*rest, last))
last ||= ->(x){x}
rest_reversed = rest.reverse_each
lambda do |*args|