lib/ree_lib/packages/ree_array/package/ree_array/functions/index_by.rb



# frozen_string_literal: true

class ReeArray::IndexBy
  include Ree::FnDSL

  fn :index_by

  contract(ArrayOf[Any], Block => Hash)
  def call(list, &proc)
    result = {}
    list.each { result[yield(_1)] = _1 }
    result
  end
end