Previously the min/max returned by read :: Distribution -> IO Stats would always be equal to the values recorded in the last stripe, due to an incorrect bugfix (see commit 813aa426be78e8abcf1c7cdd43433bcffa07828e). We can fix the original bug (as well as the current incarnation) by properly initialising new distributions with the unit elements of the corresponding monoids (inf for min and -inf for max).
For context: the max of a distribution we added to our program was always returning 0 before this fix:
The max of the distribution previously:
The sum (to prove that the distribution isn't actually 0):
The max after applying this PR (ignore the spurious 0s, that's an unrelated issue):
Previously the min/max returned by
read :: Distribution -> IO Stats
would always be equal to the values recorded in the last stripe, due to an incorrect bugfix (see commit 813aa426be78e8abcf1c7cdd43433bcffa07828e). We can fix the original bug (as well as the current incarnation) by properly initialising new distributions with the unit elements of the corresponding monoids (inf
formin
and-inf
formax
).For context: the
max
of a distribution we added to our program was always returning0
before this fix:The max of the distribution previously:
The sum (to prove that the distribution isn't actually 0):
The max after applying this PR (ignore the spurious 0s, that's an unrelated issue):