-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An implementation of Allen's interval algebra for temporal logic -- -- Please see the README on GitHub at -- https://github.com/novisci/interval-algebra @package interval-algebra @version 2.0.2 -- | The IntervalAlgebra module provides data types and related -- classes for the interval-based temporal logic described in Allen -- (1983) and axiomatized in Allen and Hayes (1987). A good -- primer on Allen's algebra can be found here. -- --
-- >>> getInterval (Interval (0, 10)) -- (0, 10) ---- --
-- >>> begin (Interval (0, 10)) -- 0 ---- --
-- >>> end (Interval (0, 10)) -- 10 --class (Ord a) => Intervallic i a -- | Get the interval from an i a. getInterval :: Intervallic i a => i a -> Interval a -- | Set the interval in an i a. setInterval :: Intervallic i a => i a -> Interval a -> i a -- | A type identifying interval parsing errors. newtype ParseErrorInterval ParseErrorInterval :: String -> ParseErrorInterval -- | Access the endpoints of an i a . begin :: Intervallic i a => i a -> a -- | Access the endpoints of an i a . end :: Intervallic i a => i a -> a -- | Safely parse a pair of as to create an Interval -- a. -- --
-- >>> parseInterval 0 1 -- Right (0, 1) ---- --
-- >>> parseInterval 1 0 -- Left (ParseErrorInterval "0<=1") --parseInterval :: (Show a, Ord a) => a -> a -> Either ParseErrorInterval (Interval a) -- | A synonym for parseInterval prsi :: (Show a, Ord a) => a -> a -> Either ParseErrorInterval (Interval a) -- | Safely creates an 'Interval a' using x as the begin -- and adding max moment dur to x as the -- end. -- --
-- >>> beginerval (0::Int) (0::Int) -- (0, 1) ---- --
-- >>> beginerval (1::Int) (0::Int) -- (0, 1) ---- --
-- >>> beginerval (2::Int) (0::Int) -- (0, 2) --beginerval :: forall a b. IntervalSizeable a b => b -> a -> Interval a -- | A synonym for beginerval bi :: IntervalSizeable a b => b -> a -> Interval a -- | Safely creates an 'Interval a' using x as the end and -- adding negate max moment dur to x as the -- begin. -- --
-- >>> enderval (0::Int) (0::Int) -- (-1, 0) ---- --
-- >>> enderval (1::Int) (0::Int) -- (-1, 0) ---- --
-- >>> enderval (2::Int) (0::Int) -- (-2, 0) --enderval :: forall a b. IntervalSizeable a b => b -> a -> Interval a -- | A synonym for enderval ei :: IntervalSizeable a b => b -> a -> Interval a -- | Safely creates an Interval from a pair of endpoints. -- IMPORTANT: This function uses beginerval, thus if the second -- element of the pair is <= the first element, the duration -- will be an Interval of moment duration. -- --
-- >>> safeInterval (4, 5 ::Int) -- (4, 5) -- -- >>> safeInterval (4, 3 :: Int) -- (4, 5) --safeInterval :: IntervalSizeable a b => (a, a) -> Interval a -- | A synonym for safeInterval si :: IntervalSizeable a b => (a, a) -> Interval a -- | Resize an i a to by expanding to "left" by l and to -- the "right" by r. In the case that l or r -- are less than a moment the respective endpoints are unchanged. -- --
-- >>> expand 0 0 (Interval (0::Int, 2::Int)) -- (0, 2) ---- --
-- >>> expand 1 1 (Interval (0::Int, 2::Int)) -- (-1, 3) --expand :: forall i a b. (IntervalSizeable a b, Intervallic i a) => b -> b -> i a -> i a -- | Expands an i a to "left". -- --
-- >>> expandl 2 (Interval (0::Int, 2::Int)) -- (-2, 2) --expandl :: (IntervalSizeable a b, Intervallic i a) => b -> i a -> i a -- | Expands an i a to "right". -- --
-- >>> expandr 2 (Interval (0::Int, 2::Int)) -- (0, 4) --expandr :: (IntervalSizeable a b, Intervallic i a) => b -> i a -> i a -- | The IntervalRelation type and the associated predicate -- functions enumerate the thirteen possible ways that two -- Interval objects may relate according to -- Allen's interval algebra. Constructors are shown with their -- corresponding predicate function. data IntervalRelation -- | before Before :: IntervalRelation -- | meets Meets :: IntervalRelation -- | overlaps Overlaps :: IntervalRelation -- | finishedBy FinishedBy :: IntervalRelation -- | contains Contains :: IntervalRelation -- | starts Starts :: IntervalRelation -- | equals Equals :: IntervalRelation -- | startedBy StartedBy :: IntervalRelation -- | during During :: IntervalRelation -- | finishes Finishes :: IntervalRelation -- | overlappedBy OverlappedBy :: IntervalRelation -- | metBy MetBy :: IntervalRelation -- | after After :: IntervalRelation -- | Does x meets y? Is x metBy y? meets :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x meets y? Is x metBy y? metBy :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x before y? Is x after y? before :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x before y? Is x after y? after :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x overlap y? Is x overlapped by y? overlaps :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x overlap y? Is x overlapped by y? overlappedBy :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x finish y? Is x finished by y? finishedBy :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x finish y? Is x finished by y? finishes :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x during y? Does x contain y? contains :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x during y? Does x contain y? during :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x start y? Is x started by y? starts :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x start y? Is x started by y? startedBy :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x equal y? equals :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x before y? Is x after y? precedes :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x before y? Is x after y? precededBy :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Are x and y disjoint (before, after, meets, or -- metBy)? disjoint :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Are x and y not disjoint (concur); i.e. do they share any support? -- This is the complement of disjoint. notDisjoint :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Are x and y not disjoint (concur); i.e. do they share any support? -- This is the complement of disjoint. concur :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x entirely *within* (enclosed by) the endpoints of y? That is, -- during, starts, finishes, or equals? within :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Does x enclose y? That is, is y within x? enclose :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Is x entirely *within* (enclosed by) the endpoints of y? That is, -- during, starts, finishes, or equals? enclosedBy :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -- | Operator for composing the union of two predicates (<|>) :: (Intervallic i0 a, Intervallic i1 a) => ComparativePredicateOf2 (i0 a) (i1 a) -> ComparativePredicateOf2 (i0 a) (i1 a) -> ComparativePredicateOf2 (i0 a) (i1 a) -- | Forms a predicate function from the union of a set of -- IntervalRelations. predicate :: (Intervallic i0 a, Intervallic i1 a) => Set IntervalRelation -> ComparativePredicateOf2 (i0 a) (i1 a) -- | Compose a list of interval relations with _or_ to create a new -- ComparativePredicateOf1 i a. For example, -- unionPredicates [before, meets] creates a predicate function -- determining if one interval is either before or meets another -- interval. unionPredicates :: [ComparativePredicateOf2 a b] -> ComparativePredicateOf2 a b -- | The set of IntervalRelation meaning two intervals are -- disjoint. disjointRelations :: Set IntervalRelation -- | The set of IntervalRelation meaning one interval is within -- the other. withinRelations :: Set IntervalRelation -- | The set of IntervalRelation meaning one interval is -- *strictly* within the other. strictWithinRelations :: Set IntervalRelation -- | Defines a predicate of two objects of type a. type ComparativePredicateOf1 a = (a -> a -> Bool) -- | Defines a predicate of two object of different types. type ComparativePredicateOf2 a b = (a -> b -> Bool) -- | Creates a new Interval from the end of an i a. beginervalFromEnd :: (IntervalSizeable a b, Intervallic i a) => b -> i a -> Interval a -- | Creates a new Interval from the begin of an i a. endervalFromBegin :: (IntervalSizeable a b, Intervallic i a) => b -> i a -> Interval a -- | Safely creates a new Interval with moment length with -- begin at x -- --
-- >>> beginervalMoment (10 :: Int) -- (10, 11) --beginervalMoment :: forall a b. IntervalSizeable a b => a -> Interval a -- | Safely creates a new Interval with moment length with -- end at x -- --
-- >>> endervalMoment (10 :: Int) -- (9, 10) --endervalMoment :: forall a b. IntervalSizeable a b => a -> Interval a -- | Modifies the endpoints of second argument's interval by taking the -- difference from the first's input's begin. >>> -- shiftFromBegin (Interval ((5::Int), 6)) (Interval (10, 15)) (5, 10) -- --
-- >>> shiftFromBegin (Interval ((1::Int), 2)) (Interval (3, 15)) -- (2, 14) --shiftFromBegin :: (IntervalSizeable a b, Functor i1, Intervallic i0 a) => i0 a -> i1 a -> i1 b -- | Modifies the endpoints of second argument's interval by taking the -- difference from the first's input's end. >>> -- shiftFromEnd (Interval ((5::Int), 6)) (Interval (10, 15)) (4, 9) -- --
-- >>> shiftFromEnd (Interval ((1::Int), 2)) (Interval (3, 15)) -- (1, 13) --shiftFromEnd :: (IntervalSizeable a b, Functor i1, Intervallic i0 a) => i0 a -> i1 a -> i1 b -- | Changes the duration of an Intervallic value to a moment -- starting at the begin of the interval. -- --
-- >>> momentize (Interval (6, 10)) -- (6, 7) --momentize :: forall i a b. (IntervalSizeable a b, Intervallic i a) => i a -> i a -- | The Set of all IntervalRelations. intervalRelations :: Set IntervalRelation -- | Compare two i a to determine their IntervalRelation. -- --
-- >>> relate (Interval (0::Int, 1)) (Interval (1, 2)) -- Meets ---- --
-- >>> relate (Interval (1::Int, 2)) (Interval (0, 1)) -- MetBy --relate :: (Intervallic i0 a, Intervallic i1 a) => i0 a -> i1 a -> IntervalRelation -- | Compose two interval relations according to the rules of the algebra. -- The rules are enumerated according to this table. compose :: IntervalRelation -> IntervalRelation -> Set IntervalRelation -- | Finds the complement of a Set IntervalRelation. complement :: Set IntervalRelation -> Set IntervalRelation -- | Find the union of two Sets of IntervalRelations. union :: Set IntervalRelation -> Set IntervalRelation -> Set IntervalRelation -- | Find the intersection of two Sets of IntervalRelations. intersection :: Set IntervalRelation -> Set IntervalRelation -> Set IntervalRelation -- | Find the converse of a Set IntervalRelation. converse :: Set IntervalRelation -> Set IntervalRelation -- | The IntervalCombinable typeclass provides methods for -- (possibly) combining two i as to form a Maybe i -- a, or in case of ><, a possibly different -- Intervallic type. class (Intervallic i a) => IntervalCombinable i a -- | Maybe form a new i a by the union of two i as that -- meets. (.+.) :: IntervalCombinable i a => i a -> i a -> Maybe (i a) -- | If x is before y, then form a new Just -- Interval a from the interval in the "gap" between x and -- y from the end of x to the begin of -- y. Otherwise, Nothing. (><) :: IntervalCombinable i a => i a -> i a -> Maybe (i a) -- | If x is before y, return f x -- appended to f y. Otherwise, return extenterval of -- x and y (wrapped in f). This is useful for -- (left) folding over an *ordered* container of Intervals and -- combining intervals when x is *not* before y. (<+>) :: (IntervalCombinable i a, Semigroup (f (i a)), Applicative f) => i a -> i a -> f (i a) -- | Creates a new Interval spanning the extent x and y. -- --
-- >>> extenterval (Interval (0, 1)) (Interval (9, 10)) -- (0, 10) --extenterval :: Intervallic i a => i a -> i a -> Interval a -- | The IntervalSizeable typeclass provides functions to determine -- the size of an Intervallic type and to resize an 'Interval a'. class (Ord a, Num b, Ord b) => IntervalSizeable a b | a -> b -- | The smallest duration for an 'Interval a'. moment :: forall a. IntervalSizeable a b => b -- | Determine the duration of an 'i a'. duration :: (IntervalSizeable a b, Intervallic i a) => i a -> b -- | Shifts an a. Most often, the b will be the same type -- as a. But for example, if a is Day then -- b could be Int. add :: IntervalSizeable a b => b -> a -> a -- | Takes the difference between two a to return a b. diff :: IntervalSizeable a b => a -> a -> b instance GHC.Generics.Generic (IntervalAlgebra.Core.Interval a) instance GHC.Classes.Eq a => GHC.Classes.Eq (IntervalAlgebra.Core.Interval a) instance GHC.Show.Show IntervalAlgebra.Core.ParseErrorInterval instance GHC.Classes.Eq IntervalAlgebra.Core.ParseErrorInterval instance GHC.Enum.Enum IntervalAlgebra.Core.IntervalRelation instance GHC.Show.Show IntervalAlgebra.Core.IntervalRelation instance GHC.Classes.Eq IntervalAlgebra.Core.IntervalRelation instance GHC.Classes.Ord a => IntervalAlgebra.Core.IntervalCombinable IntervalAlgebra.Core.Interval a instance IntervalAlgebra.Core.IntervalSizeable GHC.Types.Int GHC.Types.Int instance IntervalAlgebra.Core.IntervalSizeable GHC.Integer.Type.Integer GHC.Integer.Type.Integer instance IntervalAlgebra.Core.IntervalSizeable Data.Time.Calendar.Days.Day GHC.Integer.Type.Integer instance IntervalAlgebra.Core.IntervalSizeable Data.Time.Clock.Internal.UTCTime.UTCTime Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime instance GHC.Enum.Bounded IntervalAlgebra.Core.IntervalRelation instance GHC.Classes.Ord IntervalAlgebra.Core.IntervalRelation instance GHC.Classes.Ord a => IntervalAlgebra.Core.Intervallic IntervalAlgebra.Core.Interval a instance GHC.Base.Functor IntervalAlgebra.Core.Interval instance (GHC.Show.Show a, GHC.Classes.Ord a) => GHC.Show.Show (IntervalAlgebra.Core.Interval a) instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (IntervalAlgebra.Core.Interval a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (IntervalAlgebra.Core.Interval a) instance GHC.Classes.Ord a => GHC.Classes.Ord (IntervalAlgebra.Core.Interval a) instance (GHC.Classes.Ord a, Test.QuickCheck.Arbitrary.Arbitrary a) => Test.QuickCheck.Arbitrary.Arbitrary (IntervalAlgebra.Core.Interval a) -- | This module provides functions for creating diagrams of intervals as -- text. For example, -- --
-- >>> let ref = bi 30 (0 :: Int) -- -- >>> let ivs = [ bi 2 0, bi 5 10, bi 6 16 ] -- -- >>> pretty $ simpleIntervalDiagram ref ivs -- -- -- ----- -- ------ -- ============================== ---- --
-- >>> import Data.Time -- -- >>> let ref = bi 30 (fromGregorian 2022 5 6) -- -- >>> let ivs = [ bi 2 (fromGregorian 2022 5 6), bi 5 (fromGregorian 2022 5 10)] -- -- >>> pretty $ simpleIntervalDiagram ref ivs -- -- -- ----- -- ============================== ---- -- Such diagrams are useful for documentation, examples, and learning to -- reason with the interval algebra. -- -- There are two main functions available: -- --
-- >>> :set -XTypeApplications -XFlexibleContexts -XOverloadedStrings -- -- >>> let mkIntrvl c d b = into @(IntervalText Int) (c, bi d (b :: Int)) -- -- >>> let x = mkIntrvl '=' 20 0 -- -- >>> let l1 = [ mkIntrvl '-' 1 4 ] -- -- >>> let l2 = [ mkIntrvl '*' 3 5, mkIntrvl '*' 5 10, mkIntrvl 'x' 1 17 ] -- -- >>> let l3 = [ mkIntrvl '#' 2 18] -- -- >>> pretty $ parseIntervalDiagram defaultIntervalDiagramOptions [] (Just Bottom) x [ (l1, []), (l2, []), (l3, []) ] -- - -- *** ***** x -- ## -- ==================== ---- -- We can put the axis on the top: -- --
-- >>> pretty $ parseIntervalDiagram defaultIntervalDiagramOptions [] (Just Top) x [ (l1, []), (l2, []), (l3, []) ] -- ==================== -- - -- *** ***** x -- ## ---- -- We can annotate the axis: -- --
-- >>> pretty $ parseIntervalDiagram defaultIntervalDiagramOptions [(5, 'a')] (Just Bottom) x [ (l1, []), (l2, []), (l3, []) ] -- - -- *** ***** x -- ## -- ==================== -- | -- a ---- -- We can also annotate each line with labels: -- --
-- >>> pretty $ parseIntervalDiagram defaultIntervalDiagramOptions [] (Just Bottom) x [ (l1, ["line1"]), (l2, ["line2a", "line2b"]), (l3, ["line3"]) ] -- - <- [line1] -- *** ***** x <- [line2a, line2b] -- ## <- [line3] -- ==================== ---- -- The parser tries to check that the data can be printed. For example, -- the default LayoutOptions is 80 characters. Providing -- an reference interval wider than 80 characters results in an error. -- --
-- >>> let x = mkIntrvl '=' 100 5 -- -- >>> let ivs = [ mkIntrvl '-' 1 1 ] -- -- >>> parseIntervalDiagram defaultIntervalDiagramOptions [] Nothing x [ (ivs, []) ] -- Left AxisWiderThanAvailable ---- -- See IntervalDiagramParseError for all the cases handled. parseIntervalDiagram :: (Ord a, IntervalSizeable a b, Enum b) => IntervalDiagramOptions -> [(Int, Char)] -> Maybe AxisPlacement -> IntervalText a -> [([IntervalText a], [Text])] -> Either IntervalDiagramParseError (IntervalDiagram a) -- | Given a reference interval and a list of intervals, produces an -- IntervalDiagram with one line per interval, using the -- defaultIntervalDiagramOptions. -- --
-- >>> import Data.Maybe (fromMaybe) -- -- >>> import IntervalAlgebra.IntervalUtilities (gapsWithin) -- -- >>> pretty $ simpleIntervalDiagram (bi 10 (0 :: Int)) (fmap (bi 1) [0..9]) -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- ========== ---- --
-- >>> let ref = bi 30 (0 :: Int) -- -- >>> let ivs = [ bi 2 0, bi 5 10, bi 6 16 ] -- -- >>> pretty $ simpleIntervalDiagram ref ivs -- -- -- ----- -- ------ -- ============================== ---- --
-- >>> pretty $ simpleIntervalDiagram ref (fromMaybe [] (gapsWithin ref ivs)) -- -------- -- - -- -------- -- ============================== --simpleIntervalDiagram :: (Ord a, IntervalSizeable a b, Intervallic i a, Enum b) => i a -> [i a] -> Either IntervalDiagramParseError (IntervalDiagram a) -- | A record containing options for printing an -- IntervalDiagram. data IntervalDiagramOptions MkIntervalDiagramOptions :: LayoutOptions -> Int -> IntervalDiagramOptions -- | See LayoutOptions [layout] :: IntervalDiagramOptions -> LayoutOptions -- | Number of spaces to pad the left of the diagram by. Must be greater -- than or equal to 0. [leftPadding] :: IntervalDiagramOptions -> Int -- | Default IntervalDiagramOptions options defaultIntervalDiagramOptions :: IntervalDiagramOptions -- | A type representing options of where to place the axis in a printed -- diagram. data AxisPlacement -- | Print the axis at the top of the diagram Top :: AxisPlacement -- | Print the axis at the bottom of the diagram Bottom :: AxisPlacement -- | IntervalText is an internal type which contains an -- Interval a and the Char used to print the interval -- in a diagram. -- -- The Interval a type needs to be an instance of -- IntervalSizeable a b; Moreover, the type b should be -- castable to Int, using its From b Int -- instance. -- --
-- >>> import Prettyprinter (pretty) -- -- >>> import IntervalAlgebra (beginerval) -- -- >>> pretty $ MkIntervalText '-' (beginerval 5 (0::Int)) -- ----- -- -- >>> pretty $ MkIntervalText '*' (beginerval 10 (0::Int)) -- ********** --data IntervalText a -- | Type containing the data needed to pretty print an interval document. data IntervalDiagram a -- | A type representing errors that may occur when a list of -- IntervalText is parsed into a IntervalTextLine. data IntervalTextLineParseError -- | The inputs contains concurring intervals. All inputs should be -- disjoint. ConcurringIntervals :: IntervalTextLineParseError -- | The inputs are not sorted. UnsortedIntervals :: IntervalTextLineParseError -- | At least one of the inputs has a begin less than zero. BeginsLessThanZero :: IntervalTextLineParseError -- | A type representing errors that can occur when parsing an axis. data AxisParseError -- | Indicates that the position of one ore more axis labels is outside the -- reference interval LabelsBeyondReference :: AxisParseError -- | Indicates that multiple labels have been put at the same position MultipleLabelAtSamePosition :: AxisParseError -- | A type representing the types of invalid -- IntervalDiagramOptions. data IntervalDiagramOptionsError -- | Indicates that PageWidth is Unbounded, which -- isn't allowed for an IntervalDiagram. UnboundedPageWidth :: IntervalDiagramOptionsError -- | Indicates that the left padding in the option is < 0. LeftPaddingLessThan0 :: IntervalDiagramOptionsError -- | Type representing errors that may occur when parsing inputs into an -- IntervalDiagram. -- -- Not every possible state of a "bad" diagram is currently captured by -- parseIntervalDiagram. In particular, line labels can be a -- source of problems. The labels accept arbitrary Text. Newline -- characters in a label would, for example, throw things off. Labels -- that extend beyond the pageWidth will also cause -- problems. data IntervalDiagramParseError -- | Indicates that one or more of the input intervals extend beyond the -- axis. IntervalsExtendBeyondAxis :: IntervalDiagramParseError -- | Indicates that the reference axis is longer than the -- PageWidth given in the -- IntervalDiagramOptions. AxisWiderThanAvailable :: IntervalDiagramParseError -- | Indicates that left padding is >0 and no axis is printed. This is -- considered an error because it be impossible to know the begin -- values of intervals in a printed IntervalDiagram that has -- been padded and has no axis. PaddingWithNoAxis :: IntervalDiagramParseError -- | Indicates that an error occurring when checking the document options. OptionsError :: IntervalDiagramOptionsError -> IntervalDiagramParseError -- | Indicates something is wrong with the Axis. AxisError :: AxisParseError -> IntervalDiagramParseError -- | Indicates that at least one error occurred when parsing the interval -- lines. IntervalLineError :: IntervalTextLineParseError -> IntervalDiagramParseError instance (GHC.Show.Show a, GHC.Classes.Ord a) => GHC.Show.Show (IntervalAlgebra.IntervalDiagram.IntervalText a) instance GHC.Classes.Eq a => GHC.Classes.Eq (IntervalAlgebra.IntervalDiagram.IntervalText a) instance (GHC.Show.Show a, GHC.Classes.Ord a) => GHC.Show.Show (IntervalAlgebra.IntervalDiagram.IntervalTextLine a) instance GHC.Classes.Ord IntervalAlgebra.IntervalDiagram.IntervalTextLineParseError instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.IntervalTextLineParseError instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.IntervalTextLineParseError instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.AxisPlacement instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.AxisPlacement instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.AxisLabels instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.AxisLabels instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.AxisConfig instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.AxisConfig instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.Axis instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.Axis instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.AxisParseError instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.AxisParseError instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.IntervalDiagramOptions instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.IntervalDiagramOptions instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.IntervalDiagramOptionsError instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.IntervalDiagramOptionsError instance (GHC.Show.Show a, GHC.Classes.Ord a) => GHC.Show.Show (IntervalAlgebra.IntervalDiagram.IntervalDiagram a) instance GHC.Show.Show IntervalAlgebra.IntervalDiagram.IntervalDiagramParseError instance GHC.Classes.Eq IntervalAlgebra.IntervalDiagram.IntervalDiagramParseError instance IntervalAlgebra.Core.IntervalSizeable a b => Prettyprinter.Internal.Pretty (Data.Either.Either IntervalAlgebra.IntervalDiagram.IntervalDiagramParseError (IntervalAlgebra.IntervalDiagram.IntervalDiagram a)) instance IntervalAlgebra.Core.IntervalSizeable a b => Prettyprinter.Internal.Pretty (IntervalAlgebra.IntervalDiagram.IntervalDiagram a) instance Prettyprinter.Internal.Pretty (Data.Either.Either IntervalAlgebra.IntervalDiagram.AxisParseError IntervalAlgebra.IntervalDiagram.Axis) instance Prettyprinter.Internal.Pretty IntervalAlgebra.IntervalDiagram.Axis instance Prettyprinter.Internal.Pretty (Data.Either.Either IntervalAlgebra.IntervalDiagram.IntervalTextLineParseError (IntervalAlgebra.IntervalDiagram.IntervalTextLine GHC.Types.Int)) instance Prettyprinter.Internal.Pretty (IntervalAlgebra.IntervalDiagram.IntervalTextLine GHC.Types.Int) instance GHC.Classes.Ord a => IntervalAlgebra.Core.Intervallic IntervalAlgebra.IntervalDiagram.IntervalText a instance GHC.Base.Functor IntervalAlgebra.IntervalDiagram.IntervalText instance (GHC.Enum.Enum b, IntervalAlgebra.Core.IntervalSizeable a b) => Prettyprinter.Internal.Pretty (IntervalAlgebra.IntervalDiagram.IntervalText a) instance Witch.From.From (GHC.Types.Char, IntervalAlgebra.Core.Interval a) (IntervalAlgebra.IntervalDiagram.IntervalText a) instance Witch.From.From (IntervalAlgebra.IntervalDiagram.IntervalText a) GHC.Types.Char instance Witch.From.From (IntervalAlgebra.IntervalDiagram.IntervalText a) (IntervalAlgebra.Core.Interval a) module IntervalAlgebra.PairedInterval -- | An Interval a paired with some other data of type b. data PairedInterval b a -- | Empty is used to trivially lift an Interval a into a -- PairedInterval. data Empty Empty :: Empty -- | Make a paired interval. makePairedInterval :: b -> Interval a -> PairedInterval b a -- | Gets the data (i.e. non-interval) part of a PairedInterval. getPairData :: PairedInterval b a -> b -- | Gets the intervals from a list of paired intervals. intervals :: (Ord a, Functor f) => f (PairedInterval b a) -> f (Interval a) -- | Tests for equality of the data in a PairedInterval. equalPairData :: Eq b => ComparativePredicateOf1 (PairedInterval b a) -- | Lifts an Interval a into a PairedInterval Empty a, -- where Empty is a trivial type that contains no data. toTrivialPair :: Interval a -> PairedInterval Empty a -- | Lifts a Functor containing Interval a(s) into a -- Functor containing PairedInterval Empty a(s). trivialize :: Functor f => f (Interval a) -> f (PairedInterval Empty a) instance GHC.Generics.Generic (IntervalAlgebra.PairedInterval.PairedInterval b a) instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (IntervalAlgebra.PairedInterval.PairedInterval b a) instance GHC.Show.Show IntervalAlgebra.PairedInterval.Empty instance GHC.Classes.Ord IntervalAlgebra.PairedInterval.Empty instance GHC.Classes.Eq IntervalAlgebra.PairedInterval.Empty instance GHC.Base.Semigroup IntervalAlgebra.PairedInterval.Empty instance GHC.Base.Monoid IntervalAlgebra.PairedInterval.Empty instance GHC.Classes.Ord a => IntervalAlgebra.Core.Intervallic (IntervalAlgebra.PairedInterval.PairedInterval b) a instance GHC.Base.Functor (IntervalAlgebra.PairedInterval.PairedInterval b) instance Data.Bifunctor.Bifunctor IntervalAlgebra.PairedInterval.PairedInterval instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData b) => Control.DeepSeq.NFData (IntervalAlgebra.PairedInterval.PairedInterval b a) instance (Data.Binary.Class.Binary a, Data.Binary.Class.Binary b) => Data.Binary.Class.Binary (IntervalAlgebra.PairedInterval.PairedInterval b a) instance (GHC.Classes.Eq a, GHC.Classes.Eq b, GHC.Classes.Ord a) => GHC.Classes.Ord (IntervalAlgebra.PairedInterval.PairedInterval b a) instance (GHC.Show.Show b, GHC.Show.Show a, GHC.Classes.Ord a) => GHC.Show.Show (IntervalAlgebra.PairedInterval.PairedInterval b a) instance (GHC.Classes.Ord a, GHC.Classes.Eq b, GHC.Base.Monoid b) => IntervalAlgebra.Core.IntervalCombinable (IntervalAlgebra.PairedInterval.PairedInterval b) a instance (Test.QuickCheck.Arbitrary.Arbitrary b, GHC.Classes.Ord a, Test.QuickCheck.Arbitrary.Arbitrary a) => Test.QuickCheck.Arbitrary.Arbitrary (IntervalAlgebra.PairedInterval.PairedInterval b a) module IntervalAlgebra.IntervalUtilities -- | Returns a container of intervals where any intervals that meet or -- share support are combined into one interval. *To work properly, the -- input should be sorted*. See combineIntervalsL for a version -- that works only on lists. -- --
-- >>> combineIntervals [iv 10 0, iv 5 2, iv 2 10, iv 2 13] -- [(0, 12),(13, 15)] --combineIntervals :: (Applicative f, Ord a, Intervallic i a, Monoid (f (Interval a)), Foldable f) => f (i a) -> f (Interval a) -- | Returns a list of intervals where any intervals that meet or share -- support are combined into one interval. *To work properly, the input -- list should be sorted*. -- --
-- >>> combineIntervalsL [iv 10 0, iv 5 2, iv 2 10, iv 2 13] -- [(0, 12),(13, 15)] --combineIntervalsL :: Intervallic i a => [i a] -> [Interval a] -- | Maybe form an Interval a from Control.Foldl t => t -- (Interval a) spanning the range of all intervals in the list, -- i.e. whose begin is the minimum of begin across -- intervals in the list and whose end is the maximum of -- end. -- --
-- >>> rangeInterval [beginerval 0 0, beginerval 0 (-1)] -- Just (-1, 1) -- -- >>> rangeInterval ([] :: [Interval Int]) -- Nothing -- -- >>> rangeInterval (Just (beginerval 0 0)) -- Just (0, 1) --rangeInterval :: (Ord a, Foldable t) => t (Interval a) -> Maybe (Interval a) -- | Returns a Maybe container of intervals consisting of the gaps -- between intervals in the input. *To work properly, the input should be -- sorted*. See gapsL for a version that always returns a list. -- --
-- >>> gaps [iv 4 1, iv 4 8, iv 3 11] -- Nothing --gaps :: (IntervalCombinable i a, Traversable f, Monoid (f (Maybe (Interval a))), Applicative f) => f (i a) -> Maybe (f (Interval a)) -- | Returns a (possibly empty) list of intervals consisting of the gaps -- between intervals in the input container. *To work properly, the input -- should be sorted*. This version outputs a list. See gaps for a -- version that lifts the result to same input structure f. gapsL :: (IntervalCombinable i a, Applicative f, Monoid (f (Maybe (Interval a))), Traversable f) => f (i a) -> [Interval a] -- | Applies gaps to all the non-disjoint intervals in x -- that are *not* disjoint from i. Intervals that -- overlaps or are overlappedBy i are -- clipped to i, so that all the intervals are -- within i. If all of the input intervals are disjoint -- from the focal interval or if the input is empty, then Nothing -- is returned. When there are no gaps among the concurring intervals, -- then `Just mempty` (e.g. `Just []`) is returned. -- --
-- >>> gapsWithin (iv 9 1) [iv 5 0, iv 2 7, iv 3 12] -- Just [(5, 7),(9, 10)] --gapsWithin :: (Applicative f, Witherable f, Monoid (f (Interval a)), Monoid (f (Maybe (Interval a))), IntervalSizeable a b, Intervallic i0 a, IntervalCombinable i1 a) => i0 a -> f (i1 a) -> Maybe (f (Interval a)) -- | Folds over a list of Paired Intervals and in the case that the -- getPairData is equal between two sequential meeting intervals, -- these two intervals are combined into one. This function is "safe" in -- the sense that if the input is invalid and contains any sequential -- pairs of intervals with an IntervalRelation, other than -- Meets, then the function returns an empty list. foldMeetingSafe :: (Eq b, Ord a, Show a) => [PairedInterval b a] -> [PairedInterval b a] -- | Convert an ordered sequence of PairedInterval b a. that may -- have any interval relation (before, starts, etc) into a -- sequence of sequentially meeting PairedInterval b a. That is, -- a sequence where one the end of one interval meets the beginning of -- the subsequent event. The getPairData of the input -- PairedIntervals are combined using the Monoid <> -- function, hence the pair data must be a Monoid instance. formMeetingSequence :: (Eq b, Show a, Monoid b, IntervalSizeable a c) => [PairedInterval b a] -> [PairedInterval b a] -- | Given a predicate combinator, a predicate, and list of intervals, -- returns the input unchanged if the predicate combinator is -- True. Otherwise, returns an empty list. See -- nothingIfAny and nothingIfNone for examples. nothingIf :: (Monoid (f (i a)), Filterable f) => ((i a -> Bool) -> f (i a) -> Bool) -> (i a -> Bool) -> f (i a) -> Maybe (f (i a)) -- | Returns the Nothing if *none* of the element of input satisfy -- the predicate condition. -- -- For example, the following returns Nothing because none of the -- intervals in the input list starts (3, 5). -- --
-- >>> nothingIfNone (starts (iv 2 3)) [iv 1 3, iv 1 5] -- Nothing ---- -- In the following, (3, 5) starts (3, 6), so Just the -- input is returned. -- --
-- >>> nothingIfNone (starts (iv 2 3)) [iv 3 3, iv 1 5] -- Just [(3, 6),(5, 6)] --nothingIfNone :: (Monoid (f (i a)), Foldable f, Filterable f) => (i a -> Bool) -> f (i a) -> Maybe (f (i a)) -- | Returns Nothing if *any* of the element of input satisfy the -- predicate condition. -- --
-- >>> nothingIfAny (startedBy (iv 2 3)) [iv 3 3, iv 1 5] -- Just [(3, 6),(5, 6)] ---- --
-- >>> nothingIfAny (starts (iv 2 3)) [iv 3 3, iv 1 5] -- Nothing --nothingIfAny :: (Monoid (f (i a)), Foldable f, Filterable f) => (i a -> Bool) -> f (i a) -> Maybe (f (i a)) -- | Returns Nothing if *all* of the element of input satisfy the -- predicate condition. -- --
-- >>> nothingIfAll (starts (iv 2 3)) [iv 3 3, iv 4 3] -- Nothing --nothingIfAll :: (Monoid (f (i a)), Foldable f, Filterable f) => (i a -> Bool) -> f (i a) -> Maybe (f (i a)) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterBefore :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterMeets :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterOverlaps :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterFinishedBy :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterContains :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterStarts :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterEquals :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterStartedBy :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterDuring :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterFinishes :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterOverlappedBy :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterMetBy :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterAfter :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterDisjoint :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterNotDisjoint :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterConcur :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterWithin :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterEnclose :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Filter Filterable containers of one Intervallic -- type based by comparing to a (potentially different) -- Intervallic type using the corresponding interval predicate -- function. filterEnclosedBy :: (Filterable f, Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) -- | Creates a new Interval of a provided lookback duration ending -- at the begin of the input interval. -- --
-- >>> lookback 4 (beginerval 10 (1 :: Int)) -- (-3, 1) --lookback :: (Intervallic i a, IntervalSizeable a b) => b -> i a -> Interval a -- | Creates a new Interval of a provided lookahead duration -- beginning at the end of the input interval. -- --
-- >>> lookahead 4 (beginerval 1 (1 :: Int)) -- (2, 6) --lookahead :: (Intervallic i a, IntervalSizeable a b) => b -> i a -> Interval a -- | Create a predicate function that checks whether within a provided -- spanning interval, are there (e.g. any, all) gaps of (e.g. -- <=,=, >) a specified duration among the input intervals? makeGapsWithinPredicate :: (Monoid (t (Interval a)), Monoid (t (Maybe (Interval a))), Applicative t, Witherable t, IntervalSizeable a b, Intervallic i0 a, IntervalCombinable i1 a) => ((b -> Bool) -> t b -> Bool) -> (b -> b -> Bool) -> b -> i0 a -> t (i1 a) -> Bool -- | Gets the durations of gaps (via 'IntervalAlgebra.(><)') between -- all pairs of the input. pairGaps :: (Intervallic i a, IntervalSizeable a b, IntervalCombinable i a) => [i a] -> [Maybe b] -- | Within a provided spanning interval, are there any gaps of at least -- the specified duration among the input intervals? anyGapsWithinAtLeastDuration :: (IntervalSizeable a b, Intervallic i0 a, IntervalCombinable i1 a, Monoid (t (Interval a)), Monoid (t (Maybe (Interval a))), Applicative t, Witherable t) => b -> i0 a -> t (i1 a) -> Bool -- | Within a provided spanning interval, are all gaps less than the -- specified duration among the input intervals? -- --
-- >>> allGapsWithinLessThanDuration 30 (beginerval 100 (0::Int)) [beginerval 5 (-1), beginerval 99 10] -- True --allGapsWithinLessThanDuration :: (IntervalSizeable a b, Intervallic i0 a, IntervalCombinable i1 a, Monoid (t (Interval a)), Monoid (t (Maybe (Interval a))), Applicative t, Witherable t) => b -> i0 a -> t (i1 a) -> Bool -- | A generic form of relations which can output any -- Applicative and Monoid structure. -- --
-- >>> (relations [iv 1 0,iv 1 1]) :: [IntervalRelation] -- [Meets] --relations :: (Foldable f, Applicative m, Intervallic i a, Monoid (m IntervalRelation)) => f (i a) -> m IntervalRelation -- | Returns a list of the IntervalRelation between each consecutive -- pair of intervals. This is just a specialized relations which -- returns a list. -- --
-- >>> relationsL [iv 1 0, iv 1 1] -- [Meets] --relationsL :: (Foldable f, Intervallic i a) => f (i a) -> [IntervalRelation] -- | Forms a Just new interval from the intersection of two -- intervals, provided the intervals are not disjoint. -- --
-- >>> intersect (iv 5 0) (iv 2 3) -- Just (3, 5) --intersect :: (Intervallic i a, IntervalSizeable a b) => i a -> i a -> Maybe (Interval a) -- | In the case that x y are not disjoint, clips y to the extent of x. -- --
-- >>> clip (iv 5 0) (iv 3 3) -- Just (3, 5) ---- --
-- >>> clip (iv 3 0) (iv 2 4) -- Nothing --clip :: (Intervallic i0 a, Intervallic i1 a, IntervalSizeable a b) => i0 a -> i1 a -> Maybe (Interval a) -- | Returns the duration of each 'Intervallic i a' in the -- Functor f. -- --
-- >>> durations [iv 9 1, iv 10 2, iv 1 5] -- [9,10,1] --durations :: (Functor f, Intervallic i a, IntervalSizeable a b) => f (i a) -> f b instance GHC.Show.Show a => GHC.Show.Show (IntervalAlgebra.IntervalUtilities.Meeting a) instance GHC.Classes.Eq a => GHC.Classes.Eq (IntervalAlgebra.IntervalUtilities.Meeting a) instance GHC.Classes.Ord a => GHC.Base.Semigroup (IntervalAlgebra.IntervalUtilities.Box (IntervalAlgebra.Core.Interval a)) -- | The IntervalAlgebra module provides data types and related -- classes for the interval-based temporal logic described in Allen -- (1983) and axiomatized in Allen and Hayes (1987). A good -- primer on Allen's algebra can be found here. -- -- This main module reexports IntervalAlgebra.Core, -- IntervalAlgebra.IntervalUtilities, and -- IntervalAlgebra.PairedInterval, which is probably more than -- enough to get going for most cases. module IntervalAlgebra module IntervalAlgebra.Arbitrary -- | Conditional generation of intervals relative to a reference. If the -- reference iv is of moment duration, it is not possible -- to generate intervals from the strict enclose relations StartedBy, -- Contains, FinishedBy. If iv and rs are such that no -- possible relations can be generated, this function returns -- Nothing. Otherwise, it returns Just an interval that -- satisfies at least one of the possible relations in rs -- relative to iv. -- --
-- > import Test.QuickCheck (generate) -- > import Data.Set (fromList) -- > isJust $ generate $ arbitraryWithRelation (beginerval 10 (0::Int)) (fromList [Before]) -- Just (20, 22) -- > generate $ arbitraryWithRelation (beginerval 1 (0::Int)) (fromList [StartedBy]) -- Nothing -- > generate $ arbitraryWithRelation (beginerval 1 (0::Int)) (fromList [StartedBy, Before]) -- Just (4, 13) --arbitraryWithRelation :: forall i a b. (IntervalSizeable a b, Intervallic i a, Arbitrary (i a)) => i a -> Set IntervalRelation -> Gen (Maybe (i a)) instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Calendar.Days.Day instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Clock.Internal.DiffTime.DiffTime instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Clock.Internal.UTCTime.UTCTime -- | This module exports a single typeclass IntervalAxioms which -- contains property-based tests for the axioms in section 1 of Allen -- and Hayes (1987). The notation below is that of the original -- paper. -- -- This module is useful if creating a new instance of interval types -- that you want to test. module IntervalAlgebra.Axioms -- |