h&A;      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred+"%&'()*/015689:;>? interval-patterns&Either one of something, or two of it.Use  to deconstruct.interval-patternsApply a ! argument function appropriately.(c) Melanie Brown 2022: BSD3 (see the file LICENSE)None+"%&'()*/015689:;>?"A= interval-patternsAccording to  8https://en.wikipedia.org/wiki/Allen%27s_interval_algebraAllen, two intervals can be "adjacent" in 13 different ways, into at most 3 distinct intervals. In this package, this quality is called the   of the intervals."interval-patternsA type class for inverting &s.%interval-patternsc.f. ;.&interval-patternsA & is an endpoint of an .+interval-patterns+The kinds of extremum an interval can have.0interval-patternsThe whole interval.1interval-patternsA unidirectional pattern synonym matching finite intervals, that ignores the particular &s.2interval-patternsA bidirectional pattern synonym matching finite closed intervals.3interval-patternsA bidirectional pattern synonym matching finite closed-open intervals.4interval-patternsA bidirectional pattern synonym matching finite open-closed intervals.5interval-patterns?A bidirectional pattern synonym matching finite open intervals.6interval-patterns9A unidirectional pattern synonym ignoring the particular &s.7interval-patterns:A bidirectional pattern synonym matching closed intervals.8interval-patterns?A bidirectional pattern synonym matching closed-open intervals.9interval-patterns?A bidirectional pattern synonym matching open-closed intervals.:interval-patterns8A bidirectional pattern synonym matching open intervals.;interval-patternsThe ; of an + is its complementary analogue: how the same point would be viewed from the complement of the interval to which it belongs.c.f. %.<interval-patternsExtract the term from a &.=interval-patterns&5s have special comparison rules for identical points.3compareBounds (Min (Levitate 5)) (Max (Levitate 5))EQ3compareBounds (Inf (Levitate 5)) (Sup (Levitate 5))GT3compareBounds (Max (Levitate 5)) (Sup (Levitate 5))GT3compareBounds (Inf (Levitate 5)) (Min (Levitate 5))GT3compareBounds (Max (Levitate 5)) (Inf (Levitate 5))LT@interval-patterns Since the % constraints on the constructors for  prevent it from being a , this will have to suffice.Ainterval-patternsSame as @ but on the  of the underlying type.Binterval-patterns Since the % constraints on the constructors for  prevent it from being , this will have to suffice.Cinterval-patternsSame as B but on the  of the underlying type.Dinterval-patternsGet the (lower, upper) D of an .c.f. E, F.Einterval-patterns#Get the lower bound of an interval. lower = fst . boundsFinterval-patterns#Get the upper bound of an interval. upper = snd . boundsGinterval-patternsGet the lower bound of an interval (with the bound expressed at the term level).Hinterval-patternsGet the upper bound of an interval (with the bound expressed at the term level).Iinterval-patternsGiven  s, try to make an interval.Jinterval-patternsGiven limits and +s, try to make an interval.Kinterval-patternsThe result of having compared the same two intervals in reverse order.Linterval-patterns%Get the convex hull of two intervals.hull (7 :|>: 8) (3 :|>: 4) (3 :|>: 8))hull (Bottom :<-|: Levitate 3) (4 :<>: 5)(Bottom :<->: Levitate 5)Minterval-patterns5Get the convex hull of a non-empty list of intervals.Ninterval-patterns2Test whether a point is contained in the interval.Ointerval-patterns3Create the closed-closed interval at a given point.Pinterval-patterns7Get the infimum of an interval, weakening if necessary.Qinterval-patterns-Get the minimum of an interval, if it exists.Rinterval-patterns,Get the maximum of an interval if it exists.Sinterval-patterns8Get the supremum of an interval, weakening if necessary.Tinterval-patterns'Open both bounds of the given interval.Uinterval-patterns(Close both bounds of the given interval.Vinterval-patterns?Make the interval open-closed, leaving the endpoints unchanged.Winterval-patterns?Make the interval closed-open, leaving the endpoints unchanged.Xinterval-patterns;Make the lower bound open, leaving the endpoints unchanged.Yinterval-patterns=Make the lower bound closed, leaving the endpoints unchanged.Zinterval-patterns;Make the upper bound open, leaving the endpoints unchanged.[interval-patterns=Make the upper bound closed, leaving the endpoints unchanged.^interval-patternsCalculate the  & between two intervals, according to  8https://en.wikipedia.org/wiki/Allen%27s_interval_algebraAllen._interval-patterns:Calculate the intersection of two intervals, if it exists.  >>> intersect (2 :<>: 4) (3 :||: 5) Just (3 :|>: 4) >>> intersect (2 :<>: 4) (4 :||: 5) Nothing >>> intersect (1 :<>: 4) (2 :||: 3) Just (2 :||: 3) `interval-patterns*Get the union of two intervals, as either .  >>> union (2 :||: 5) (5 :<>: 7) One (Levitate 2 :|->: Levitate 7) >>> union (2 :||: 4) (5 :<>: 7) Two (Levitate 2 :|-|: Levitate 4) (Levitate 5 : -: Levitate 7) ainterval-patterns O(n log n)'. Get the union of a list of intervals.This function uses  . See also b.binterval-patternsO(n).. Get the union of a sorted list of intervals.8NOTE: The input condition is not checked. Use with care.cinterval-patterns1Take the complement of the interval, as possibly .  >>> complement (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) Note that infinitely-open intervals will return the points at infinity toward which they are infinite in their result:  >>> complement (Levitate 3 : -=: Top) Just (Two (Bottom :|-|: Levitate 3) (Top :|-|: Top)) dinterval-patterns8Remove all points of the second interval from the first.  >>> difference Whole (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) >>> difference (1 :<>: 4) (2 :||: 3) Just (Two (1 :<>: 2) (3 :<>: 4)) >>> difference (1 :|>: 4) (0 :||: 1) Just (One (1 :<>: 4)) >>> difference (1 :<>: 4) (0 :||: 1) Just (One (1 :<>: 4)) einterval-patternsInfix synonym for dfinterval-patterns>The difference of the union and intersection of two intervals.  >>> symmetricDifference Whole (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) >>> symmetricDifference (1 :<>: 4) (2 :||: 3) Just (Two (1 :<>: 2) (3 :<>: 4)) ginterval-patternsGet the measure of an interval. 6 >>> measure (-1 :<>: 1) Just 2 >>> measure (Bottom : -: Levitate 1) Nothing hinterval-patternsApply a function to the lower, then upper, endpoint of an interval.  >>> measuring max (-1 :<>: 1) Just 1 >>> measuring min (-1 :<>: 1) Just (-1) >>> measuring (*) (4 :<>: 6) Just 24 iinterval-patterns?Get the distance between two intervals, or 0 if they adjacency.  >>> hausdorff (3 :<>: 5) (6 :<>: 7) Just 1 >>> hausdorff (3 :<>: 5) Whole Just 0 jinterval-patternsm j r( creates the closed interval centred at m with radius r.$For the open interval, simply write T (x j y).kinterval-patternsFull containment.  !"#$%&*'()+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk+,-./;&*'()<"#$%= !?>@ABC:9876543210jJDEGFHIQPSRLMNOTUVWXYZ[\] K^_`abcdefghik 555525354555758595:5 Safe-Inferred+"%&'()*/015689:;>?,interval-patternsThe  sets on a type are the sets generated by its intervals. It forms a  algebra with  as join and  as meet, and a  with  as addition and  as multiplication (and  as negation). In fact the algebra is Boolean as the operation x  y =  x  y.It is a monoid that is convenient for agglomerating groups of intervals, such as for calculating the overall timespan of a group of events. However, it is agnostic of how many times each given point has been covered. To keep track of this data, use .interval-patterns Consider the  set identified by a list of s.interval-patternsTurn a  set into a  of s.interval-patterns The empty  set.interval-patternsThe  set consisting of a single .interval-patternsIs this  set empty?interval-patterns Insert an  into a " set, agglomerating along the way.interval-patterns The maximal # set, that covers the entire range.interval-patternsCompletely remove an  from a # set. Essentially the opposite of .interval-patternsFlipped infix version of .interval-patternsIs this point N any connected component of the  set?interval-patternsIs this point not N any connected component of the  set?interval-patternsA synonym for .interval-patternsA synonym for .interval-patterns6Remove all intervals of the second set from the first.interval-patterns%Take the symmetric difference of two  sets.interval-patterns Take the 3 set consisting of each point not in the given one.interval-patterns Given an  i,  i will trim a  set so that its  is contained in i.interval-patternsFlipped infix version of .interval-patternsTake the intersection of two  sets.interval-patterns#Take the intersection of a list of  sets.interval-patternsTake the smallest spanning  of a - set, provided that it is not the empty set. Safe-Inferred+"%&'()*/015689:;>?3interval-patternsA blank canvas.interval-patternssingleton ix y is the rectangle with base ix of thickness y.interval-patterns Draw the $ of specified bases and thicknesses.interval-patterns,Get all of the bases and thicknesses in the .interval-patterns Ignore the & and focus only on whether points are within any contained  or not.interval-patterns insert ix y l draws over l a rectangle with base ix of thickness y.interval-patternsFlipped synonym for 0. Mnemonic: "pile" this much onto the existing  over the given .interval-patterns1Take away a thickness over a given base from the .interval-patternsCompletely remove an  from the .interval-patternsFliped infix version of .interval-patterns'Add the given thickness to every point.interval-patternsExcavate$ the second argument from the first.interval-patternsRestrict the range of the  to the given .interval-patternsFlipped infix version of .interval-patterns diff hgt ix l calculates the area under the  ix using the measure diff* of the interval multiplied by the height hgt5 of the layers over each sub-interval in the layers.interval-patternsGet the thickness of the  at a point.interval-patterns$Where and how thick is the thickest ?interval-patterns Convert the  into a list of beginning-points and heights, that define a step function piecewise. Safe-Inferred+"%&'()*/015689:;>?4interval-patterns !type Timeframe = Interval UTCTime  !"%#$#&)(*'+/.,-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk Safe-Inferred+"%&'()*/015689:;>?: interval-patternsA / is a map from a given event type to durations.interval-patternsAn  is a collection of s that keeps track of how deeply a particular interval has been overlapped. %type Event n = Layers UTCTime (Sum n)interval-patterns Make a new  from a  with default thickness 1. event = eventSize 1interval-patternsMake an  with the given size from a .interval-patternsMeasure the carried load of an  over a given . In other words: how many copies of you would you need, in order to attend all of the simultaneous happenings over a given span (on average)?interval-patterns The empty .interval-patternsMake a  from an .interval-patternsMake a  from a .interval-patterns Insert an  of the given sort into a .interval-patternsGet the # corresponding to a given key, or  if the key is not present.interval-patternsGet the # corresponding to a given key, or  if the key is not present.interval-patterns6What, and how many events are happening at the given  on this ?interval-patterns?Consider every kind of event the same, and observe the overall .  !"%#$#&)(*'+/.,-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk      !"#$%&'(()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ghkmjSrk0interval-patterns-0.7.0.1-9Wq9gEOUNPdFZ2i7RQlIgf Data.OneOrTwo Data.IntervalData.Interval.BorelData.Interval.LayersData.Timeframe Data.CalendarLayersOneOrTwoOneTwooneOrTwo $fEqOneOrTwo $fOrdOneOrTwo$fShowOneOrTwo$fReadOneOrTwo$fGenericOneOrTwo$fDataOneOrTwo$fFunctorOneOrTwo$fFoldableOneOrTwo$fTraversableOneOrTwo AdjacencyBeforeMeetsOverlapsStartsDuringFinishes Identical FinishedByContains StartedBy OverlappedByMetByAfterInterval:<-->::<--|::|-->::|--|: SomeBoundBoundingOppositebound opposeBoundBoundMinInfSupMaxExtremumMinimumInfimumSupremumMaximumWhole:--::||::|>::<|::<>::---::|-|::|->::<-|::<->:oppositeunBound compareBoundsoppose unSomeBoundimapimapLev itraverse itraverseLevboundslowerupper lowerBound upperBoundinterval...converseAdjacencyhullhullswithinpointiinfiminimaxisupopenclose openclosed closedopen openLower closedLower openUpper closedUppersetLowersetUpper adjacency intersectunionunions unionsAsc complement difference\\symmetricDifferencemeasure measuring hausdorff+/- isSubsetOf $fOrdBound $fEqBound$fTraversableBound$fFoldableBound$fFunctorBound$fBoundingMaximum$fBoundingSupremum$fBoundingInfimum$fBoundingMinimum$fOrdSomeBound $fEqSomeBound$fGenericInterval$fDataInterval $fOrdInterval$fShowInterval $fEqAdjacency$fOrdAdjacency$fShowAdjacency$fGenericAdjacency$fDataAdjacency $fEqExtremum $fOrdExtremum$fEnumExtremum$fBoundedExtremum$fShowExtremum$fReadExtremum$fGenericExtremum$fDataExtremum $fEqIntervalBorelborel intervalSetempty singletonnullinsertwholeremove\-member notMembertruncate\= intersection intersections $fRingBorel$fSemiringBorel$fHeytingBorel$fBoundedJoinSemiLatticeBorel$fBoundedMeetSemiLatticeBorel$fLatticeBorel $fMonoidBorel$fSemigroupBorel $fEqBorel $fOrdBorel $fShowBorel$fGenericBorel $fDataBorelfromListtoListsquashpiledigbaseline integrate thicknessthickesttoStepFunctionnestings $fGroupLayers$fMonoidLayers$fSemigroupLayers $fEqLayers $fOrdLayers $fShowLayers$fFunctorLayers$fGenericLayers $fDataLayers TimeframelocalTimeframeAtlocalTimeframepureLocalTimeframedurationCalendar getCalendarEventevent eventSizeerlangscalendar!?! happeningAtcoalesce totalDuration$fMonoidCalendar$fSemigroupCalendar $fEqCalendar $fOrdCalendar$fShowCalendarghc-prim GHC.ClassesOrdbaseGHC.BaseFunctor%lattices-2.0.3-IeiRdy42qtUEsxjfbxEDPnAlgebra.Lattice.Levitated LevitatedData.Traversable Traversable Data.OldListsortAlgebra.HeytingHeyting$semirings-0.6-FDSWy2RrznQ2q3n2IxlKEJ Data.SemiringRing==>Algebra.Lattice\/containers-0.6.5.1Data.Set.InternalSet<> Data.Foldablefold GHC.MaybeNothingmempty time-1.11.1.1 Data.Time.Clock.Internal.UTCTimeUTCTime