View Source argo_index_map (argo v1.0.6)
Summary
Types
-type filter_func() :: filter_func(index(), key(), value()).
-type filter_func(Index, Key, Value) :: fun((Index, Key, Value) -> boolean()).
-type filtermap_func() :: filtermap_func(index(), key(), value(), value()).
-type filtermap_func(Index, Key, Value1, Value2) :: fun((Index, Key, Value1) -> boolean() | {true, Value2}).
-type groups_from_list_key_fun() :: groups_from_list_key_fun(dynamic(), key()).
-type groups_from_list_key_fun(Elem, Key) :: fun((Elem) -> Key).
-type groups_from_list_value_fun() :: groups_from_list_value_fun(dynamic(), value()).
-type groups_from_list_value_fun(Elem, Value) :: fun((Elem) -> Value).
-type index() :: non_neg_integer().
-opaque iterator(KeyType, ValueType)
-type iterator_order() :: iterator_order(key()).
-type iterator_order(Key) :: ordered | reversed | iterator_order_func(Key).
-type key() :: dynamic().
-type t(KeyType, ValueType) :: #argo_index_map{indices :: #{KeyType => index()}, entries :: array:array({KeyType, ValueType})}.
-type value() :: dynamic().
Functions
-spec groups_from_list(KeyFun, List) -> IndexMap when KeyFun :: groups_from_list_key_fun(Elem, Key), List :: [Elem], Elem :: dynamic(), Key :: key(), Value :: value(), IndexMap :: t(Key, Value).
-spec groups_from_list(KeyFun, ValueFun, List) -> IndexMap when KeyFun :: groups_from_list_key_fun(Elem, Key), ValueFun :: groups_from_list_value_fun(Elem, Value), List :: [Elem], Elem :: dynamic(), Key :: key(), Value :: value(), IndexMap :: t(Key, Value).
-spec iterator(IndexMap, Order) -> Iterator when Key :: key(), Value :: value(), IndexMap :: t(Key, Value), Order :: iterator_order(Key), Iterator :: iterator(Key, Value).
-spec new() -> IndexMap when IndexMap :: t().
-spec size(IndexMap) -> non_neg_integer() when IndexMap :: t().
-spec sort(SortFun, IndexMap1) -> IndexMap2 when SortFun :: iterator_order_func(Key), Key :: key(), Value :: value(), IndexMap1 :: t(Key, Value), IndexMap2 :: t(Key, Value).