lib/rumonade/array.rb in rumonade-0.3.0 vs lib/rumonade/array.rb in rumonade-0.4.0
- old
+ new
@@ -12,9 +12,12 @@
[]
end
end
module InstanceMethods
+ # Preserve native +map+ method for performance
+ METHODS_TO_REPLACE_WITH_MONAD = Monad::DEFAULT_METHODS_TO_REPLACE_WITH_MONAD - [:map]
+
def bind(lam = nil, &blk)
inject(self.class.empty) { |arr, elt| arr + (lam || blk).call(elt).to_a }
end
end
end