5 6 7 8 9 10 11 12
# File 'lib/easy_monads/option_functions.rb', line 5 def self.sum_option_in_hash(hash, key, option) if hash[key].is_a? Some hash[key] = hash[key].bind { |value| Some.unit(value + option.get) } else hash[key] = option end hash end