[{"name":"Interval","comment":" A representation of numeric intervals (also known as _ranges_.)\r\n\r\n\r\n# Types\r\n\r\n@docs Interval\r\n@docs Bound\r\n\r\n\r\n# Constructors\r\n\r\n`interval` is the primary constructor; the others are just for convenience.\r\n\r\n@docs interval\r\n@docs degenerate\r\n@docs empty\r\n@docs leftBounded\r\n@docs rightBounded\r\n@docs unbounded\r\n\r\n\r\n# Endpoint (Bound) constructors\r\n\r\n@docs excludes\r\n@docs includes\r\n\r\n\r\n# Operations on Intervals\r\n\r\n@docs hull\r\n@docs intersection\r\n@docs intervalToString\r\n@docs interior\r\n@docs closure\r\n@docs subtract\r\n@docs upperBoundValue\r\n@docs lowerBoundValue\r\n\r\n\r\n# Tests on Intervals\r\n\r\n@docs adjoins\r\n@docs intersects\r\n@docs intersectsPoint\r\n@docs isBounded\r\n@docs isDegenerate\r\n@docs isEmpty\r\n@docs isLeftBounded\r\n@docs isRightBounded\r\n@docs isLeftOpen\r\n@docs isRightOpen\r\n\r\n\r\n# Related reading\r\n\r\n  - [Interval](https://en.wikipedia.org/wiki/Interval_(mathematics))\r\n  - [Interval tree](https://en.wikipedia.org/wiki/Interval_tree)\r\n  - [Allen's interval algebra](https://en.wikipedia.org/wiki/Allen%27s_interval_algebra)\r\n\r\n","unions":[{"name":"Bound","comment":" Represents an upper or lower, closed or open endpoint of an Interval.\r\nThis encompasses the \"endpoints\" of unbounded intervals when the bound value\r\nis either of the `Infinity` values in the floating point spec.\r\n\r\nOpaque type.\r\n\r\n","args":[],"cases":[]},{"name":"Interval","comment":" An interval over the reals. May be over either the Ordinary Reals `(-∞, +∞)` or\r\nthe Extended Reals `[-∞, +∞]`.\r\n`Bounded x y` will always satisfy `x < y`. (`x == y` is either degenerate or empty)\r\n\r\nOpaque type.\r\n\r\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"adjoins","comment":" Are these two intervals adjoins? I.e., do they share an upper-lower or\r\nlower-upper bound, exactly one of which is closed, and do not intersect each other?\r\n\r\n    let\r\n        a = interval (includes 1) (excludes 3)  -- [1, 3)\r\n        b = interval (includes 2) (includes 4)  -- [3, 4]\r\n        c = interval (excludes 3) (includes 4)  -- (3, 4]\r\n        d = interval (includes 2) (includes 3)  -- [2, 3]\r\n    in\r\n        [ adjoins a b = True\r\n        , adjoins a c = False\r\n        , adjoins a d = False\r\n        ]\r\n\r\n","type":"Interval.Interval -> Interval.Interval -> Basics.Bool"},{"name":"closure","comment":" Returns the smallest closed interval containing a.\r\n\r\n    -- `closure((x, y)) == [x, y]`\r\n    interior (interval (excludes 0) (excludes 2)) == interval (includes 0) (includes 2)\r\n\r\n","type":"Interval.Interval -> Interval.Interval"},{"name":"degenerate","comment":" A degenerate Interval.\r\n","type":"Basics.Float -> Interval.Interval"},{"name":"empty","comment":" An empty Interval.\r\n","type":"Interval.Interval"},{"name":"excludes","comment":" An exclusive endpoint of an interval.\r\n","type":"Basics.Float -> Interval.Bound"},{"name":"hull","comment":" The convex hull of two intervals. This is similar to union in that\r\nit includes all the points of the component intervals, and for\r\nnon-overlapping intervals, the points between them.\r\n","type":"Interval.Interval -> Interval.Interval -> Interval.Interval"},{"name":"includes","comment":" An inclusive endpoint of an interval.\r\n","type":"Basics.Float -> Interval.Bound"},{"name":"interior","comment":" Returns the largest open interval contained within a.\r\n\r\n    -- `interior([x, y]) == (x, y)`\r\n    interior (interval (includes 0) (includes 2)) == interval (excludes 0) (excludes 2)\r\n\r\n","type":"Interval.Interval -> Interval.Interval"},{"name":"intersection","comment":" The intersection of two intervals. If the intervals overlap, this is the common part.\r\nIf not, this is the empty interval.\r\n","type":"Interval.Interval -> Interval.Interval -> Interval.Interval"},{"name":"intersects","comment":" Do these two intervals intersect?\r\n\r\n    let\r\n        a = interval (includes 1) (excludes 3)\r\n        b = interval (includes 2) (includes 4)\r\n        c = interval (includes 3) (includes 4)\r\n    in\r\n        [ intersects a b = True\r\n        , intersects a c = False\r\n        ]\r\n\r\n","type":"Interval.Interval -> Interval.Interval -> Basics.Bool"},{"name":"intersectsPoint","comment":" Does this interval contain the given point?\r\n\r\n    let\r\n        a = interval (includes 1) (excludes 3)\r\n    in\r\n        [ intersectsPoint a 0 = False\r\n        , intersectsPoint a 1 = True\r\n        , intersectsPoint a 3 = False\r\n        ]\r\n\r\n","type":"Interval.Interval -> Basics.Float -> Basics.Bool"},{"name":"interval","comment":" Constructs an `Interval` from two Bounds.\r\n","type":"Interval.Bound -> Interval.Bound -> Interval.Interval"},{"name":"intervalToString","comment":" Return a String representation of an Interval.\r\n","type":"Interval.Interval -> String.String"},{"name":"isBounded","comment":" Does this interval have finite bounds?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"isDegenerate","comment":" Is this a degenerate (point-valued) interval?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"isEmpty","comment":" Is this an empty interval?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"isLeftBounded","comment":" Does this interval have a finite lower bound, and an infinite upper bound?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"isLeftOpen","comment":" Is the lower bound of this interval open?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"isRightBounded","comment":" Does this interval have a finite upper bound, and an infinite lower bound?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"isRightOpen","comment":" Is the upper bound of this interval open?\r\n","type":"Interval.Interval -> Basics.Bool"},{"name":"leftBounded","comment":" Convenience function for a left-bounded Interval (from some n to +∞)\r\n","type":"Interval.Bound -> Interval.Interval"},{"name":"lowerBoundValue","comment":" Extract the value of the lower bound of an Interval.\r\n","type":"Interval.Interval -> Maybe.Maybe Basics.Float"},{"name":"rightBounded","comment":" Convenience function for a right-bounded Interval (from -∞ to some n)\r\n","type":"Interval.Bound -> Interval.Interval"},{"name":"subtract","comment":" Subtract interval `b` from interval `a`, returning a list of the parts of\r\n`a` that did not intersect with `b`.\r\n\r\nE.g.:\r\n\r\n  - [1, 3) - (1, 2] = [ {1}, (2, 3) ]\r\n\r\n","type":"Interval.Interval -> Interval.Interval -> List.List Interval.Interval"},{"name":"unbounded","comment":" An unbounded Interval over the [Extended Reals.] `[-∞, +∞]`\r\n\r\n[Extended Reals.]: https://en.wikipedia.org/wiki/Interval_(mathematics)#Infinite_endpoints\r\n\r\n","type":"Interval.Interval"},{"name":"upperBoundValue","comment":" Extract the value of the upper bound of an Interval.\r\n","type":"Interval.Interval -> Maybe.Maybe Basics.Float"}],"binops":[]},{"name":"Union","comment":" A set of strictly ordered, fully disjoint Intervals.\r\n\r\n\r\n# Types\r\n\r\n@docs Union\r\n\r\n@docs fromInterval\r\n@docs fromIntervals\r\n\r\n@docs union\r\n@docs unionOfIntervals\r\n\r\n@docs intersection\r\n@docs intersectionWithInterval\r\n@docs subtract\r\n@docs subtractInterval\r\n@docs subtractUnions\r\n@docs unionToString\r\n\r\n","unions":[{"name":"Union","comment":" A set of strictly non-overlapping Intervals.\r\n\r\nOpaque type; do not export.\r\n\r\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"fromInterval","comment":" Construct a \"union\" from a single Interval.\r\n","type":"Interval.Interval -> Union.Union"},{"name":"fromIntervals","comment":" Additively construct a union from an unordered list of arbitrary Intervals.\r\n","type":"List.List Interval.Interval -> Union.Union"},{"name":"intersection","comment":" Return the intersection of two Unions.\r\nE.g.:\r\n\r\n  - { [1, 2) } ∩ { [3, 5] } = {}\r\n  - { [1, 3) } ∩ { [2, 5] } = { [2, 3) }\r\n  - { [1, 3), [4, 6] } ∩ { [2, 5] } = { [2, 3), [4, 5] }\r\n\r\n","type":"Union.Union -> Union.Union -> Union.Union"},{"name":"intersectionWithInterval","comment":" Return the intersection of an interval with a Union.\r\nE.g.:\r\n\r\n  - [1, 2) ∩ { [3, 5] } = {}\r\n  - [1, 3) ∩ { [2, 5] } = { [2, 3) }\r\n  - [2, 5] ∩ { [1, 3), [4, 6] } = { [2, 3), [4, 5] }\r\n\r\n","type":"Interval.Interval -> Union.Union -> Union.Union"},{"name":"subtract","comment":" Subtract interval `b` from interval `a`, returning the parts of\r\n`a` that did not intersect with `b`.\r\n\r\nE.g.:\r\n\r\n  - [1, 3) - (1, 2] = { {1}, (2, 3) }\r\n\r\n","type":"Interval.Interval -> Interval.Interval -> Union.Union"},{"name":"subtractInterval","comment":" Subtract an interval from the given union, returning the contents of the\r\nunion that did not intersect with the interval.\r\n\r\nE.g.:\r\n\r\n  - { [1, 3), (5, 8] } - (1, 3) = { {1}, (5, 8] }\r\n\r\n","type":"Interval.Interval -> Union.Union -> Union.Union"},{"name":"subtractUnions","comment":" Subtract union `b` from union `a`, returning the contents of `a` that\r\ndid not intersect with `b`.\r\n\r\nE.g.:\r\n\r\n  - { [1, 3), (5, 8] } - { (1, 3), [6, 7] } = { {1}, (5, 6), (7, 8] }\r\n\r\n","type":"Union.Union -> Union.Union -> Union.Union"},{"name":"union","comment":" Merge two Unions.\r\nE.g.:\r\n\r\n  - { [1, 2) } ∪ { [3, 4] } = { [1, 2), [3, 4] }\r\n  - { [1, 2) } ∪ { [2, 3] } = { [1, 3] }\r\n  - { [1, 2) } ∪ { (2, 3] } = { [1, 2), (2, 3] }\r\n\r\n","type":"Union.Union -> Union.Union -> Union.Union"},{"name":"unionOfIntervals","comment":" Construct a Union from the additive merger of two Intervals.\r\nE.g.:\r\n\r\n  - [1, 2) ∪ [3, 4] = { [1, 2), [3, 4] }\r\n\r\n","type":"Interval.Interval -> Interval.Interval -> Union.Union"},{"name":"unionToString","comment":" Return the string representation of the given Union.\r\n","type":"Union.Union -> String.String"}],"binops":[]}]