Combines two T
instances associatively.
Combines two T
instances associatively.
result of combining l
and r
Returns an instance of T
calculated by summing all instances in
iter
in one pass.
Returns an instance of T
calculated by summing all instances in
iter
in one pass. Returns None
if iter
is empty, else
Some[T]
.
instances of T
to be combined
None
if iter
is empty, else an option value containing the summed T
Returns the identity element of T
for plus.
Returns the identity element of T
for plus.
This Monoid allows code to depends on the results of asynchronous computation. It is relatively common to have code which takes a Monoid and elements, but applies the computation in an opaque way (a cache, for example). This allows the code handing over the elements (in this case, Tunnel objects) to depend on the result of the Monoid's computation. Note that this code does not depend on any particular Monoid -- that dependency is strictly when the Tunnel objects are created. This is the async analogue of Function1Monoid.