h$2\-      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None+ #$%&'(-./235678;<=>?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+ #$%&'(-./235678;<=>?@9 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. 9.&interval-patternsA & is an endpoint of an .+interval-patterns+The kinds of extremum an interval can have.0interval-patternsThe whole interval.1interval-patterns3A pattern synonym matching finite closed intervals.2interval-patterns8A pattern synonym matching finite closed-open intervals.3interval-patterns8A pattern synonym matching finite open-closed intervals.4interval-patterns1A pattern synonym matching finite open intervals.5interval-patterns,A pattern synonym matching closed intervals.6interval-patterns1A pattern synonym matching closed-open intervals.7interval-patterns1A pattern synonym matching open-closed intervals.8interval-patterns*A pattern synonym matching open intervals.9interval-patternsThe 9 of an extremum is how it would be viewed from the other "direction" of how it is currently.c.f. %.:interval-patternsExtract the term from a &.;interval-patterns&5s have special comparison rules for identical points.minima are lesser than infimasuprema are lesser than maxima9infima and minima are both lesser than suprema and maxima>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.Ainterval-patternsSame as @ but on the  of the underlying type.Binterval-patternsGet the (lower, upper) B of an .c.f. C, D.Cinterval-patterns#Get the lower bound of an interval. lower = fst . boundsDinterval-patterns#Get the upper bound of an interval. upper = snd . boundsEinterval-patternsGet the lower bound of an interval (with the bound expressed at the term level).Finterval-patternsGet the upper bound of an interval (with the bound expressed at the term level).Ginterval-patternsGiven  s, try to make an interval.Hinterval-patternsThe result of having compared the same two intervals in reverse order.Iinterval-patterns%Get the convex hull of two intervals.hull (7 :|>: 8) (3 :|>: 4)(Levitate 3 :|->: Levitate 8) hull (Bottom :<-|: 3) (3 :<|: 4)(Bottom :<-|: Levitate 4)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-patterns-Get the minimum of an interval, if it exists.Ninterval-patterns7Get the infimum of an interval, weakening if necessary.Ointerval-patterns8Get the supremum of an interval, weakening if necessary.Pinterval-patterns,Get the maximum of an interval if it exists.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-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 (Levitate 3 :|->: Levitate 4) >>> intersect (2 :<>: 4) (4 :||: 5) Nothing >>> intersect (1 :<>: 4) (2 :||: 3) Just (Levitate 2 :|-|: Levitate 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) ^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 .  >>> complement (3 :<>: 4) Just (Two (Bottom :|-|: Levitate 3) (Levitate 4 :|-|: Top)) ainterval-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 (Levitate 1 : -: Levitate 2) (Levitate 3 : -: Levitate 4)) binterval-patternsInfix synonym for acinterval-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 (Levitate 1 : -: Levitate 2) (Levitate 3 : -: Levitate 4)) dinterval-patternsGet the measure of an interval. 6 >>> measure (-1 :<>: 1) Just 2 >>> measure (Bottom : -: Levitate 1) Nothing einterval-patternsApply a function to the lower, then upper, endpoint of an interval.  >>> measuring max (-1 :<>: 1) Just 1 >>> measuring min (-1 :<>: 1) Just (-1) finterval-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 ginterval-patternsm g r( creates the closed interval centred at m with radius r.$For the open interval, simply write Q (x g y).  !"#$%&*'()+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg+,-./9&*'():"#$%; !=<>?@A876543210BCEDFGMNOPIJKLQRSTUVWXYZ H[\]^_`abcdefg 55551525354555657585None+ #$%&'(-./235678;<=>?'interval-patternsThe  sets on a type are the sets generated by its open 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.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-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.None+ #$%&'(-./235678;<=>?+ interval-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-patternsGet the thickness of the  at a point.interval-patterns$Where and how thick is the thickest ?interval-patterns insert ix y l draws over l a rectangle with base ix of thickness y.interval-patterns1Take away a thickness over a given base from the .interval-patterns'Add the given thickness to every point.  None+ #$%&'(-./235678;<=>?- interval-patternsAn 0 is something that happens for a period of time. %type Event n = Layers UTCTime (Sum n)interval-patterns !type Timeframe = Interval UTCTime  !"%#$#&)(*'+/.,-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg      !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~cdgifO0interval-patterns-0.2.0.1-5IEJQVZOhrW5Vnz72Ma3YD Data.OneOrTwo Data.IntervalData.Interval.BorelData.Interval.LayersData.TimeframeLayersOneOrTwoOneTwooneOrTwo $fEqOneOrTwo $fOrdOneOrTwo$fShowOneOrTwo$fReadOneOrTwo$fGenericOneOrTwo$fDataOneOrTwo$fFunctorOneOrTwo$fFoldableOneOrTwo$fTraversableOneOrTwo AdjacencyBeforeMeetsOverlapsStartsDuringFinishes Identical FinishedByContains StartedBy OverlappedByMetByAfterInterval:<-->::<--|::|-->::|--|: SomeBoundBoundingOppositebound opposeBoundBoundMinInfSupMaxExtremumMinimumInfimumSupremumMaximumWhole:||::|>::<|::<>::|-|::|->::<-|::<->:oppositeunBound compareBoundsoppose unSomeBoundimapimapS itraverse itraverseSboundslowerupper lowerBound upperBoundintervalconverseAdjacencyhullhullswithinpointiminiinfisupimaxopenclose openclosed closedopen openLower closedLower openUpper closedUppersetLowersetUpper adjacency intersectunionunions unionsAsc complement difference\\symmetricDifferencemeasure measuring hausdorff+/- $fOrdBound $fEqBound$fTraversableBound$fFoldableBound$fFunctorBound$fBoundingMaximum$fBoundingSupremum$fBoundingInfimum$fBoundingMinimum$fOrdSomeBound $fEqSomeBound $fOrdInterval$fShowInterval $fEqAdjacency$fOrdAdjacency$fShowAdjacency$fGenericAdjacency $fEqExtremum $fOrdExtremum$fEnumExtremum$fBoundedExtremum$fShowExtremum$fReadExtremum$fGenericExtremum$fDataExtremum $fEqIntervalBorelborel intervalSetempty singletonnullinsertwholecutoutmember notMemberclip intersection intersections $fRingBorel$fSemiringBorel$fHeytingBorel$fBoundedJoinSemiLatticeBorel$fBoundedMeetSemiLatticeBorel$fLatticeBorel $fMonoidBorel$fSemigroupBorel $fOneBorel $fEqBorel $fOrdBorel $fShowBorel$fGenericBorelfromListtoListsquash thicknessthickestnestings nestingsAscremovebaseline $fGroupLayers$fMonoidLayers$fSemigroupLayers $fEqLayers $fOrdLayers $fShowLayers$fFunctorLayers$fGenericLayersCalendar getCalendarEvent TimeframelocalTimeframeAtlocalTimeframepureLocalTimeframedurationeventcalendaraddEvent totalDuration$fMonoidCalendar$fSemigroupCalendar $fEqCalendar $fOrdCalendar$fShowCalendarghc-prim GHC.ClassesOrdbaseGHC.BaseFunctor$lattices-2.0.3-5ASpuz9oEnCYID7TaUwIpAlgebra.Lattice.Levitated LevitatedData.Traversable Traversable Data.OldListsortAlgebra.HeytingHeyting$semirings-0.6-L6a1C3p7N9dB4CY2Q5m88B Data.SemiringRing==>Algebra.Lattice\/containers-0.6.2.1Data.Set.InternalSet<> Data.Foldablefold