Easy Monads - Monads for Ruby, with Option
Created to provide an easy implementation of monads for Ruby. Monads are practical and easy to grok (or at least they should be). Here is an excellent tutorial that explains some of the benefits of monads: monads-are-not-metaphors.
Inspiration for easy_monads largely comes from Scala's Option, and Option is implemented here. The goal of EasyMonad::Option isn't to mirror Scala's implementation, but it tries to follow the general pattern. If you are a Scala fan and are looking for Scala semantics in Ruby applications, you should have a look at rumonade in addition to easy_monads. If you are just looking for an implentation of Option for Ruby, EasyMonads::Option is an easy choice.
To add Option to the Object class:
require 'easy_monads' EasyMonads.option_everywhere!
Copyright (c) 2011 Stephen Sloan, Bookrenter.com. See LICENSE.txt for further details.