- Dr. Alistair Ward
- Describes a bounded set of, typically integral, quantities.
- Operations have been defined, on the list of consecutive quantities delimited by these endpoints.
- The point is that if the list is composed from consecutive quantities, the intermediate values can be inferred, rather than physically represented.
- The API was driven top-down by its caller's requirements, rather than a bottom-up attempt to provide a complete interface. consequently there may be omissions from the view point of future callers.
- Thought similar to the mathematical concept of an interval, the latter technically relates to real numbers; http://en.wikipedia.org/wiki/Interval_%28mathematics%29.
- No account has been made for semi-closed or open intervals.
- type Interval endPoint = (endPoint, endPoint)
- closedUnitInterval :: Num n => Interval n
- mkBounded :: Bounded endPoint => Interval endPoint
- elem' :: Ord endPoint => endPoint -> Interval endPoint -> Bool
- normalise :: Ord endPoint => Interval endPoint -> Interval endPoint
- product' :: (Integral i, Show i) => Ratio i -> i -> Interval i -> i
- shift :: Num endPoint => endPoint -> Interval endPoint -> Interval endPoint
- splitAt' :: (Enum endPoint, Num endPoint, Ord endPoint, Show endPoint) => endPoint -> Interval endPoint -> (Interval endPoint, Interval endPoint)
- toList :: Enum endPoint => Interval endPoint -> [endPoint]
- getMinBound :: Interval endPoint -> endPoint
- getMaxBound :: Interval endPoint -> endPoint
- precisely :: endPoint -> Interval endPoint
- isReversed :: Ord endPoint => Interval endPoint -> Bool
Defines a closed (inclusive) interval of consecutive values.
Construct the unsigned closed unit-interval; http://en.wikipedia.org/wiki/Unit_interval.
True if the specified value is within the inclusive bounds of the interval.
Swap the end-points where they were originally reversed, but otherwise do nothing.
|:: (Integral i, Show i)|
|=> Ratio i|
The ratio at which to bisect the
For efficiency, the interval will not be bisected, when it's length has been reduced to this value.
|-> Interval i|
The resulting product.
- Multiplies the consecutive sequence of integers within
- Since the result can be large,
divideAndConqueris used to form operands of a similar order of magnitude, thus improving the efficiency of the big-number multiplication.
|:: Num endPoint|
The magnitude of the require shift.
|-> Interval endPoint|
The interval to be shifted.
|-> Interval endPoint|
Shift of both end-points of the interval by the specified amount.
Bisect the interval at the specified end-point; which should be between the two existing end-points.