lib/rumonade/monad.rb in rumonade-0.4.3 vs lib/rumonade/monad.rb in rumonade-0.4.4
- old
+ new
@@ -50,10 +50,10 @@
# Returns a monad whose elements are the ultimate (non-monadic) values contained in all nested monads
#
# NOTE: normally aliased as +flatten+ when +Monad+ is mixed into a class
#
# @example
- # [Some(Some(1)), Some(Some(None))], [None]].flatten
+ # [Some(Some(1)), Some(Some(None))], [None]].flatten_with_monad
# #=> [1]
#
def flatten_with_monad(depth=nil)
if depth.is_a? Integer
depth.times.inject(self) { |e, _| e.shallow_flatten }