Copyright | (c) NoviSci Inc 2020-2022 TargetRWE 2023 |
---|---|
License | BSD3 |
Maintainer | bsaul@novisci.com 2020-2022, bbrown@targetrwe.com 2023 |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- arbitrarySizedPositive :: Integral a => Gen a
- maxDiffTime :: Int
- sizedIntervalGen :: (SizedIv (Interval a), Ord (Moment (Interval a))) => Int -> Gen a -> Gen (Moment (Interval a)) -> Gen (Interval a)
- genDay :: Gen Day
- genNominalDiffTime :: Gen NominalDiffTime
- genDiffTime :: Gen DiffTime
- genUTCTime :: Gen UTCTime
- arbitraryWithRelation :: forall i a b. (SizedIv (Interval a), Ord a, Eq (Moment (Interval a)), Arbitrary (Interval a)) => Interval a -> Set IntervalRelation -> Gen (Maybe (Interval a))
Documentation
arbitrarySizedPositive :: Integral a => Gen a Source #
maxDiffTime :: Int Source #
sizedIntervalGen :: (SizedIv (Interval a), Ord (Moment (Interval a))) => Int -> Gen a -> Gen (Moment (Interval a)) -> Gen (Interval a) Source #
genUTCTime :: Gen UTCTime Source #
arbitraryWithRelation Source #
:: forall i a b. (SizedIv (Interval a), Ord a, Eq (Moment (Interval a)), Arbitrary (Interval a)) | |
=> Interval a | reference interval |
-> Set IntervalRelation | set of |
-> Gen (Maybe (Interval a)) |
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)