BoundedModule
Operations over values that carry their permitted range.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Representation | ||
| Value | this.Value | Returns the underlying value, which always lies within the bounds. |
| Bounds | this.Bounds | Returns the interval the value is constrained to. |
| BoundedValue | BoundedValue | No description available. |
| BoundsValue | BoundsValue | No description available. |
| Operations | ||
| clamp | Bounded.clamp bounds value | Restricts a value into the bounds. |
| create | Bounded.create bounds value | Admits a value only when it already lies within the bounds. |
| refinement | Bounded.refinement bounds | Returns a refinement admitting values within the supplied bounds. |
| value | Bounded.value input | Returns the underlying value. |
| bounds | Bounded.bounds input | Returns the interval the value is constrained to. |
| isAtBound | Bounded.isAtBound input | Returns whether the value sits on either bound. |
| map | Bounded.map mapping input | Applies a mapping and re-clamps into the same bounds, so the invariant survives a mapping that would otherwise leave the range. |
| withBounds | Bounded.withBounds newBounds input | Moves a value into different bounds, clamping as needed. |