README.md in ribimaybe-0.0.13 vs README.md in ribimaybe-0.1.0
- old
+ new
@@ -80,25 +80,26 @@
``` ruby
include Ribimaybe::Maybe
# Chain together computations and pretend you're a Haskeller.
Just(42).bind do |x|
- rturn(x - 21)
-end.bind do |x|
- rturn(x * 2)
+ unit(x - 21).bind do |y|
+ if x * x > 100 then unit(x) else unit(y) end
+ end
end # => Just(42)
# You guessed it! If have Nothing, you get Nothing.
Nothing.bind do |x|
- rturn(x * x)
+ unit(x * x)
end # => Nothing
-# We even have >= but you need to pass a Proc or a lambda.
+# We even have >>= but it's called >= and you you need to pass a Proc or a
+# lambda.
Just(42) >= -> (x) do
- rturn(x - 21) >= -> (y) do
- if x * x > 100 then rturn(y) else rturn(x) end
+ unit(x - 21) >= -> (y) do
+ if x * x > 100 then unit(x) else unit(y) end
end
-end
+end # => Just(42)
```
## Contributing
1. Fork it