h*D>      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.8.0 Safe-Inferred"%&(-1="interval-patterns&Either one of something, or two of it.Use  to deconstruct.interval-patternsApply a ! argument function appropriately.(c) Melanie Brown 2023BSD3 (see the file LICENSE)None"%&(-1=#P 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-patterns&Open-open interval. You probably want 6 or 1.interval-patterns(Open-closed interval. You probably want 5 or 0.interval-patterns(Closed-open interval. You probably want 4 or /.interval-patterns*Closed-closed interval. You probably want 3 or ..interval-patternsA type class for inverting "s.!interval-patternsc.f. 7."interval-patternsA " is an endpoint of an .'interval-patterns+The kinds of extremum an interval can have.,interval-patternsThe whole interval,  3 .-interval-patternsA unidirectional pattern synonym matching finite intervals, that ignores the particular "s..interval-patternsA bidirectional pattern synonym matching finite closed intervals./interval-patternsA bidirectional pattern synonym matching finite closed-open intervals.0interval-patternsA bidirectional pattern synonym matching finite open-closed intervals.1interval-patterns?A bidirectional pattern synonym matching finite open intervals.2interval-patterns9A unidirectional pattern synonym ignoring the particular "s.3interval-patterns:A bidirectional pattern synonym matching closed intervals.4interval-patterns?A bidirectional pattern synonym matching closed-open intervals.5interval-patterns?A bidirectional pattern synonym matching open-closed intervals.6interval-patterns8A bidirectional pattern synonym matching open intervals.7interval-patternsThe 7 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. !.8interval-patternsExtract the term from a ".9interval-patterns"5s have special comparison rules for identical points.3compareBounds (Min (Levitate 0)) (Max (Levitate 0))EQ3compareBounds (Inf (Levitate 0)) (Sup (Levitate 0))GT3compareBounds (Max (Levitate 0)) (Sup (Levitate 0))GT3compareBounds (Inf (Levitate 0)) (Min (Levitate 0))GT3compareBounds (Max (Levitate 0)) (Inf (Levitate 0))LT<interval-patterns Since the % constraints on the constructors for  prevent it from being a , this will have to suffice.=interval-patternsSame as < but on the  of the underlying type.>interval-patterns Since the % constraints on the constructors for  prevent it from being , this will have to suffice.?interval-patternsSame as > but on the  of the underlying type.@interval-patternsGet the (A, B) bounds of an .Ainterval-patterns#Get the lower bound of an interval. lower = fst . boundsBinterval-patterns#Get the upper bound of an interval. upper = snd . boundsCinterval-patternsGet the lower bound of an interval (with the bound expressed at the term level).Dinterval-patternsGet the upper bound of an interval (with the bound expressed at the term level).Einterval-patternsGiven s, try to make an interval.Finterval-patternsGiven limits and 's, try to make an interval.Ginterval-patternsThe result of having compared the same two intervals in reverse order.Hinterval-patternsCalculate the  & between two intervals, according to  8https://en.wikipedia.org/wiki/Allen%27s_interval_algebraAllen.Iinterval-patterns%Get the convex hull of two intervals.hull (7 :|>: 8) (3 :|>: 4) (3 :|>: 8))hull (Bottom :<-|: Levitate 3) (4 :<>: 5)(Bottom :<->: Levitate 5)Jinterval-patterns5Get the convex hull of a non-empty list of intervals.Kinterval-patterns2Test whether a point is contained in the interval.Linterval-patterns3Create the closed-closed interval at a given point.Minterval-patterns7Get the infimum of an interval, weakening if necessary.Ninterval-patterns-Get the minimum of an interval, if it exists.Ointerval-patterns-Get the maximum of an interval, if it exists.Pinterval-patterns8Get the supremum of an interval, weakening if necessary.Qinterval-patterns'Open both bounds of the given interval.Rinterval-patterns(Close both bounds of the given interval.Sinterval-patterns?Make the interval open-closed, leaving the endpoints unchanged.Tinterval-patterns?Make the interval closed-open, leaving the endpoints unchanged.Uinterval-patterns;Make the lower bound open, leaving the endpoints unchanged.Vinterval-patterns=Make the lower bound closed, leaving the endpoints unchanged.Winterval-patterns;Make the upper bound open, leaving the endpoints unchanged.Xinterval-patterns=Make the upper bound closed, leaving the endpoints unchanged.[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 (2 :|>: 7) >>> union (2 :||: 4) (5 :<>: 7) Two (2 :||: 4) (5 :<>: 7) ]interval-patterns O(n log n)'. Get the union of a list of intervals.This function uses  . See also ^.^interval-patternsO(n).. Get the union of a sorted list of intervals.8NOTE: The input condition is not checked. Use with care._interval-patterns1Take the complement of the interval, as possibly  . See also . >>> complement (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) Note that infinitely-open intervals will include in their result the points at infinity toward which they are infinite:  >>> complement (Levitate 3 : ->: Top) Just (Two (Bottom :|-|: Levitate 3) (Top :|-|: Top)) `interval-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 :||: 5) Just (One (1 :<>: 2)) >>> difference (1 :|>: 4) (0 :||: 1) Just (One (1 :<>: 4)) >>> difference (1 :<>: 4) (0 :||: 1) Just (One (1 :<>: 4)) ainterval-patternsInfix synonym for `binterval-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 :||: 5) Just (Two (1 :<>: 2) (4 :||: 5)) cinterval-patterns#Get the measure of an interval, or  if the interval is infinite. 5>>> measure (-1 :<>: 1) Just 2 >>> measure (Bottom : -: Levitate 1) Nothing dinterval-patternsApply a function to the lower, then upper, endpoint of an interval. >>> measuring const (-1 :<>: 1) Just (-1) >>> measuring (*) (4 :<>: 6) Just 24 measure == measuring subtracteinterval-patterns'Get the distance between two intervals. >>> hausdorff (3 :<>: 5) (6 :<>: 7) Just 1 >>> hausdorff (3 :<>: 5) Whole Just 0 finterval-patternsm f r( creates the closed interval centred at m with radius r.$For the open interval, simply write Q (x f y).ginterval-patternsFull containment.10/.-65432,fFEL@ACBDNMPO<=>?QRSTUVWXYZ IJKGH[\]^_`abcdeg'()*+7"#&$%8 !9;:10/.-65432,fFEL@ACBDNMPO<=>?QRSTUVWXYZ IJKGH[\]^_`abcdeg'()*+7"#&$%8 !9;: 5555.5/5051535455565 Safe-Inferred"%&(-1=-interval-patterns%Newtype wrapper for the monoid under .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 K any connected component of the  set?interval-patternsIs this point not K 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"%&(-1=6interval-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   any contained  or not.interval-patterns Treating  as sea level, consider the  set of a provided  that is "land".An improvement over  in that it will not return    if 7 or some involved interval calculations have been used.interval-patterns"Given a "sea level", consider the  set of a provided  that is "land".An improvement over  in that it will not return    if 7 or some involved interval calculations have been used.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"%&(-1=7interval-patterns !type Timeframe = Interval UTCTime'()*+ "#&$% !10/.-65432,K@_a\[Rg]`DCfFELABNMPO<=>?QSTUVWXYZIJGH^bcde789;: Safe-Inferred"%&(-1=>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 .interval-patternsCalculate the total length of a particular event across all occurrences.'()*+ "#&$% !10/.-65432,K@_a\[Rg]`DCfFELABNMPO<=>?QSTUVWXYZIJGH^bcde789;:  !"#$%&'())*+,-./01234567 89:;<=>?@ABCDEFGHIJKLMNOPQRSTU VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~fgikTp  i.interval-patterns-0.8.0-BzcshY5RLEW8SWgNfdCVP3 Data.OneOrTwo Data.IntervalData.Interval.BorelData.Interval.LayersData.Timeframe Data.Calendarinterval-patterns complementLayerswithinIWholeOneOrTwoOneTwooneOrTwo $fEqOneOrTwo $fOrdOneOrTwo$fShowOneOrTwo$fReadOneOrTwo$fGenericOneOrTwo$fDataOneOrTwo$fFunctorOneOrTwo$fFoldableOneOrTwo$fTraversableOneOrTwo AdjacencyBeforeMeetsOverlapsStartsDuringFinishes Identical FinishedByContains StartedBy OverlappedByMetByAfterInterval SomeBoundBoundingOppositebound opposeBoundBoundMinInfSupMaxExtremumMinimumInfimumSupremumMaximum:--::||::|>::<|::<>::---::|-|::|->::<-|::<->:oppositeunBound compareBoundsoppose unSomeBoundimapimapLev itraverse itraverseLevboundslowerupper lowerBound upperBoundinterval...converseAdjacency adjacencyhullhullspointiinfiminimaxisupopenclose openclosed closedopen openLower closedLower openUpper closedUppersetLowersetUpper intersectunionunions unionsAsc difference\\symmetricDifferencemeasure measuring hausdorff+/- isSubsetOf $fOrdBound $fEqBound$fTraversableBound$fFoldableBound$fFunctorBound$fBoundingMaximum$fBoundingSupremum$fBoundingInfimum$fBoundingMinimum$fOrdSomeBound $fEqSomeBound$fNFDataInterval$fHashableInterval$fGenericInterval$fDataInterval $fOrdInterval$fShowInterval $fEqAdjacency$fOrdAdjacency$fShowAdjacency$fGenericAdjacency$fDataAdjacency $fEqExtremum $fOrdExtremum$fEnumExtremum$fBoundedExtremum$fShowExtremum$fReadExtremum$fGenericExtremum$fDataExtremum $fEqIntervalShrink getShrinkBorelborel intervalSetempty singletonnullinsertwholeremove\-member notMembertruncate\= intersection intersections $fRingBorel$fSemiringBorel$fHeytingBorel$fBoundedJoinSemiLatticeBorel$fBoundedMeetSemiLatticeBorel$fLatticeBorel $fMonoidBorel$fSemigroupBorel$fMonoidShrink$fSemigroupShrink $fEqShrink $fOrdShrink $fShowShrink$fGenericShrink $fDataShrink $fEqBorel $fOrdBorel $fShowBorel$fGenericBorel $fDataBorelfromListtoListsquashland landAbovepiledigbaseline integrate thicknessthickesttoStepFunctionnestings $fGroupLayers$fMonoidLayers$fSemigroupLayers $fEqLayers $fOrdLayers $fShowLayers$fFunctorLayers$fGenericLayers $fDataLayers TimeframelocalTimeframeAtlocalTimeframepureLocalTimeframedurationCalendar getCalendarEventevent eventSizeerlangscalendar!?! happeningAtcoalesce totalDuration$fMonoidCalendar$fSemigroupCalendar $fEqCalendar $fOrdCalendar$fShowCalendar:<-->::<--|::|-->::|--|:#lattices-2.2-AzANpXDKAR6CEulxE0kfq7Algebra.Lattice.LevitatedBottomTopghc-prim GHC.ClassesOrdbaseGHC.BaseFunctor LevitatedData.Traversable Traversable Data.OldListsort GHC.MaybeNothingAlgebra.HeytingHeyting$semirings-0.6-AyelP0fxezAJ5MCLguBQX9 Data.SemiringRing==>Algebra.Lattice\/containers-0.6.7Data.Set.InternalSet<> Data.Foldablefoldmempty time-1.12.2 Data.Time.Clock.Internal.UTCTimeUTCTime