úÎRPNÇ#      !"DeriveDataTypeable experimentalekmett@gmail.com Safe-Inferred'HThe rule of thumb is you should only use this to construct using values H that you took out of the interval. Otherwise, use I, to force rounding The whole real number line whole-Infinity ... InfinityAn empty interval empty NaN ... NaNnegation handles NaN properly null (1 ... 5)Falsenull (1 ... 1)False null emptyTrueA singleton point  singleton 11 ... 1+The infinumum (lower bound) of an interval inf (1 ... 20)1*The supremum (upper bound) of an interval sup (1 ... 20)20 #Is the interval a singleton point? < N.B. This is fairly fragile and likely will not hold after 4 even a few operations that only involve singletons singular (singleton 1)Truesingular (1.0 ... 20.0)False $Calculate the width of an interval. width (1 ... 20)19width (singleton 1)0 width emptyNaN  Magnitude magnitude (1 ... 20)20magnitude (-20 ... 10)20magnitude (singleton 5)5 " mignitude" mignitude (1 ... 20)1mignitude (-20 ... 10)10mignitude (singleton 5)5 $Bisect an interval at its midpoint. bisection (10.0 ... 20.0)(10.0 ... 15.0,15.0 ... 20.0)bisection (singleton 5.0)(5.0 ... 5.0,5.0 ... 5.0)bisection empty(NaN ... NaN,NaN ... NaN)/Nearest point to the midpoint of the interval. midpoint (10.0 ... 20.0)15.0midpoint (singleton 5.0)5.0midpoint emptyNaN)Determine if a point is in the interval. elem 3.2 (1.0 ... 5.0)Trueelem 5 (1.0 ... 5.0)Trueelem 1 (1.0 ... 5.0)Trueelem 8 (1.0 ... 5.0)False elem 5 emptyFalse5Determine if a point is not included in the interval notElem 8 (1.0 ... 5.0)TruenotElem 1.4 (1.0 ... 5.0)False:And of course, nothing is a member of the empty interval. notElem 5 emptyTrue#:lift a monotone increasing function over a given interval $:lift a monotone decreasing function over a given interval -Calculate the intersection of two intervals. Hintersection (1 ... 10 :: Interval Double) (5 ... 15 :: Interval Double) 5.0 ... 10.0+Calculate the convex hull of two intervals @hull (0 ... 10 :: Interval Double) (5 ... 15 :: Interval Double) 0.0 ... 15.0Ahull (15 ... 85 :: Interval Double) (0 ... 10 :: Interval Double) 0.0 ... 85.0For all x in X, y in Y. x % y ?(5 ... 10 :: Interval Double) <! (20 ... 30 :: Interval Double)True?(5 ... 10 :: Interval Double) <! (10 ... 30 :: Interval Double)False?(20 ... 30 :: Interval Double) <! (5 ... 10 :: Interval Double)FalseFor all x in X, y in Y. x & y @(5 ... 10 :: Interval Double) <=! (20 ... 30 :: Interval Double)True@(5 ... 10 :: Interval Double) <=! (10 ... 30 :: Interval Double)True@(20 ... 30 :: Interval Double) <=! (5 ... 10 :: Interval Double)FalseFor all x in X, y in Y. x ' y %Only singleton intervals return true E(singleton 5 :: Interval Double) ==! (singleton 5 :: Interval Double)True?(5 ... 10 :: Interval Double) ==! (5 ... 10 :: Interval Double)False(For all x in X, y in Y. x ) y @(5 ... 15 :: Interval Double) /=! (20 ... 40 :: Interval Double)True@(5 ... 15 :: Interval Double) /=! (15 ... 40 :: Interval Double)FalseFor all x in X, y in Y. x * y @(20 ... 40 :: Interval Double) >! (10 ... 19 :: Interval Double)True?(5 ... 20 :: Interval Double) >! (15 ... 40 :: Interval Double)FalseFor all x in X, y in Y. x + y A(20 ... 40 :: Interval Double) >=! (10 ... 20 :: Interval Double)True@(5 ... 20 :: Interval Double) >=! (15 ... 40 :: Interval Double)FalseFor all x in X, y in Y. x op y Check if interval X totally contains interval Y H(20 ... 40 :: Interval Double) `contains` (25 ... 35 :: Interval Double)TrueH(20 ... 40 :: Interval Double) `contains` (15 ... 35 :: Interval Double)FalseFlipped version of . Check if interval X a subset of interval Y J(25 ... 35 :: Interval Double) `isSubsetOf` (20 ... 40 :: Interval Double)TrueJ(20 ... 40 :: Interval Double) `isSubsetOf` (15 ... 35 :: Interval Double)FalseDoes there exist an x in X, y in Y such that x % y? Does there exist an x in X, y in Y such that x & y? Does there exist an x in X, y in Y such that x ' y? ,Does there exist an x in X, y in Y such that x ) y? Does there exist an x in X, y in Y such that x * y? Does there exist an x in X, y in Y such that x + y? Does there exist an x in X, y in Y such that x op y? !+id function. Useful for type specification :t idouble (1 ... 3)$idouble (1 ... 3) :: Interval Double"+id function. Useful for type specification :t ifloat (1 ... 3)"ifloat (1 ... 3) :: Interval Float-FWe have to play some semantic games to make these methods make sense. 1 Most compute with the midpoint of the interval. ./ will use the midpoint >0123 4567#$(, !"-89:;.<=>?@ABCD#  !"#   !"=0123 4567#$(, !"-89:;.<=>?@ABCDE      !"#$%&'()'(*'(+,'(-'(.'(/0123456789:;<=>?@ABCDEFGHIJK intervals-0.4Numeric.IntervalIntervalI...wholeemptynull singletoninfsupsingularwidth magnitude mignitude bisectionmidpointelemnotElem intersectionhull!>=! certainlycontains isSubsetOf?>=?possiblyidoubleifloat increasing decreasingghc-prim GHC.Classes<<===/=!/=>>=/=?$fRealFloatInterval$fRealIntervalbaseGHC.Real realToFrac negInfinity posInfinitynanfmod divNonZero divPositive divNegativedivZero$fFloatingInterval$fRealFracInterval$fFractionalInterval $fOrdInterval $fNumInterval$fShowInterval $fEqInterval$fDistributiveInterval$fMonadInterval$fApplicativeInterval$fTraversableInterval$fFoldableInterval$fFunctorInterval