| Copyright | (c) NoviSci Inc 2020 |
|---|---|
| License | BSD3 |
| Maintainer | bsaul@novisci.com |
| Stability | experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
IntervalAlgebra.Arbitrary
Contents
Description
Synopsis
- arbitraryWithRelation :: (IntervalSizeable a b, Intervallic i a, Arbitrary (i a)) => i a -> Set IntervalRelation -> Gen (Maybe (i a))
Documentation
arbitraryWithRelation Source #
Arguments
| :: (IntervalSizeable a b, Intervallic i a, Arbitrary (i a)) | |
| => i a | reference interval |
| -> Set IntervalRelation | set of |
| -> Gen (Maybe (i 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.
>>>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)
Orphan instances
| Arbitrary UTCTime Source # | |
| Arbitrary NominalDiffTime Source # | |
| Arbitrary DiffTime Source # | |
| Arbitrary Day Source # | |
| Arbitrary (Interval Int) Source # | |
| Arbitrary (Interval UTCTime) Source # | |
| Arbitrary (Interval Day) Source # | |
| (Arbitrary b, Arbitrary (Interval a)) => Arbitrary (PairedInterval b a) Source # | |
Methods arbitrary :: Gen (PairedInterval b a) # shrink :: PairedInterval b a -> [PairedInterval b a] # | |