Incr_map_collateSourceval collate :
?operation_order:[ `Filter_first | `Sort_first ] ->
filter_equal:('filter -> 'filter -> bool) ->
order_equal:('order -> 'order -> bool) ->
filter_to_predicate:('filter -> (key:'k -> data:'v -> bool) option) ->
order_to_compare:('order -> ('k, 'v, 'cmp) Compare.t) ->
(('k, 'v, 'cmp) Core.Map.t, 'w) Incremental.t ->
(('k, 'filter, 'order) Collate.t, 'w) Incremental.t ->
(('k, 'v) Collated.t, 'w) Incremental.tPerform filtering, sorting and restricting to ranges.
The Collate.t Incr.t contains the parameters for filtering and sorting, and ranges. It can be updated incrementally, but note that filtering & sorting isn't really incremental on filter & order since we bind to these.
For sorting & filtering, technically all this function should need is a compare function and a filtering predicate. However, the interface is slightly different: we require users to provide 'filter and 'order opaque types in Collate.t, and ways to convert them to predicate & compare here.
It is done this way for better interaction with Incr. We belive that most users would have such types, being simple algebraic data types, anyways. You can always set e.g. filter_to_predicate=Fn.id, and just pass the functions directly, but be prepared to explore the fascinating world of functions' physical equality.
val collate_and_fold :
?operation_order:[ `Filter_first | `Sort_first ] ->
filter_equal:('filter -> 'filter -> bool) ->
order_equal:('order -> 'order -> bool) ->
filter_to_predicate:('filter -> (key:'k -> data:'v -> bool) option) ->
order_to_compare:('order -> ('k, 'v, 'cmp) Compare.t) ->
fold:('k, 'v, 'fold_result) Fold.t ->
(('k, 'v, 'cmp) Core.Map.t, 'w) Incremental.t ->
(('k, 'filter, 'order) Collate.t, 'w) Incremental.t ->
(('k, 'v) Collated.t, 'w) Incremental.t * ('fold_result, 'w) Incremental.tA version of collate with caching.