Intervals with arbitrary endpoint representations #
The endpoint pair does not impose an order, radix, infinity representation, or rounding policy.
Contains interprets finite endpoints through an explicit partial decoder. Failed decoding
excludes NaNs, NaRs, and other values outside the chosen scalar interpretation.
An endpoint pair; construction alone does not assert that the bounds are ordered.
- lo : α
Lower endpoint.
- hi : α
Upper endpoint.
Instances For
Instances For
Instances For
A point interval preserves its endpoint representation exactly.
Instances For
Keep finite ordered bounds; special values and reversed bounds return none.
Instances For
Partial outward rounding for any endpoint carrier and ordered scalar interpretation.
Success certifies finite decoded bounds; failure can report overflow or an unavailable enclosure. In particular, this interface does not require bounded formats to represent infinities.
- decode : α → Option β
Finite scalar interpretation of an encoded endpoint.
Try to bracket an exact scalar by representable endpoints.
Every successful result encloses the exact scalar.