This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
Manifest | ||
| |
README.rdoc | ||
| |
Rakefile | ||
| |
VERSION | ||
| |
do_notation.gemspec | ||
| |
lib/ | ||
| |
test/ |
README.rdoc
Haskell-style monad do-notation for Ruby
Example:
require 'do_notation'
class Array
include Monad
def self.unit x
[x]
end
def bind &f
map(&f).inject([]){ |a,b| a+b }
end
end
Array.run do
x <- ["first", "second"]
y <- ["once", "twice"]
unit("#{x} cousin #{y} removed")
end
The above code returns the array:
["first cousin once removed",
"first cousin twice removed",
"second cousin once removed",
"second cousin twice removed"]
For more examples, see the test suite.
Installation
gem install do_notation -s http://gemcutter.org
By Aanand Prasad (aanand.prasad@gmail.com)








