Like calling andThen on the present function
Like calling andThen on the present function
This may error if inputs are empty (for Monoid Aggregators it never will, instead you see present(Monoid.zero[B])
This may error if inputs are empty (for Monoid Aggregators it never will, instead you see present(Monoid.zero[B])
This returns the cumulative sum of its inputs, in the same order.
This returns the cumulative sum of its inputs, in the same order. If the inputs are empty, the result will be empty too.
This returns None if the inputs are empty
This returns None if the inputs are empty
Like calling compose on the prepare function
Like calling compose on the prepare function
This returns the cumulative sum of its inputs, in the same order.
This returns the cumulative sum of its inputs, in the same order. If the inputs are empty, the result will be empty too.
Build a MonoidAggregator that either takes left or right input and outputs the pair from both
Build a MonoidAggregator that either takes left or right input and outputs the pair from both
Only aggregate items that match a predicate
Only aggregate items that match a predicate
This allows you to run two aggregators on the same data with a single pass
This allows you to run two aggregators on the same data with a single pass
This may error if items is empty.
This may error if items is empty. To be safe you might use reduceOption if you don't know that items is non-empty
combine two inner values
combine two inner values
This is the safe version of the above.
This is the safe version of the above. If the input in empty, return None, else reduce the items
This maps the inputs to Bs, then sums them, effectively flattening the inputs to the MonoidAggregator
This maps the inputs to Bs, then sums them, effectively flattening the inputs to the MonoidAggregator
An Aggregator can be converted to a Fold, but not vice-versa Note, a Fold is more constrained so only do this if you require joining a Fold with an Aggregator to produce a Fold
An Aggregator can be converted to a Fold, but not vice-versa Note, a Fold is more constrained so only do this if you require joining a Fold with an Aggregator to produce a Fold
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
The law here is: ag1.zip(ag2).apply(as.zip(bs)) == (ag1(as), ag2(bs))
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
The law here is: ag1.zip(ag2).apply(as.zip(bs)) == (ag1(as), ag2(bs))
This gives you the
max
smallest items. If you want the biggest reverse the Ordering. Note that PriorityQueue is mutable so it is a good idea to copy this into an immutable view before using it, as is done in PriorityQueueToListAggregator