The PR amends instances of Fractional for Interval and IntervalSet to comply with the property above. The instance for IntervalSet remains total. The instance for Interval throws DivideByZero, when 0 is an interior point (because in this case xs // {0} is not an interval but two adjacent intervals).
Coverage decreased (-0.2%) to 86.154% when pulling 1829f9e9429cd39393af3a0487e7b743b7fcfdaf on Bodigrim:recip-zero into 71917515ac187b6d319a6cc65bcfeb5719ecae4c on msakai:master.
I was surprised to learn the behaviour of
recip
on intervals, containing 0:I'd expect that
This expectation can be expressed as a property
The PR amends instances of
Fractional
forInterval
andIntervalSet
to comply with the property above. The instance forIntervalSet
remains total. The instance forInterval
throwsDivideByZero
, when0
is an interior point (because in this casexs // {0}
is not an interval but two adjacent intervals).