Module: Functional::PatternMatching

Defined in:
lib/functional/pattern_matching.rb,
lib/functional/method_signature.rb

Overview

As much as I love Ruby I've always been a little disappointed that Ruby doesn't support function overloading. Function overloading tends to reduce branching and keep function signatures simpler. No sweat, I learned to do without. Then I started programming in Erlang. My favorite Erlang feature is, without question, pattern matching. Pattern matching is like function overloading cranked to 11. So one day I was musing on Twitter that I'd like to see Erlang-stype pattern matching in Ruby and one of my friends responded "Build it!" So I did. And here it is.