Copyright | (c) 2014-2015 Leonid Onokhov (c) 2014-2015 Leon P Smith |
---|---|
License | BSD3 |
Maintainer | Leon P Smith <leon@melding-monads.com> |
Safe Haskell | None |
Language | Haskell98 |
- data RangeBound a
- = NegInfinity
- | Inclusive !a
- | Exclusive !a
- | PosInfinity
- data PGRange a = PGRange !(RangeBound a) !(RangeBound a)
- empty :: PGRange a
- isEmpty :: Ord a => PGRange a -> Bool
- isEmptyBy :: (a -> a -> Ordering) -> PGRange a -> Bool
- contains :: Ord a => PGRange a -> a -> Bool
- containsBy :: (a -> a -> Ordering) -> PGRange a -> a -> Bool
Documentation
data RangeBound a Source
Represents boundary of a range
Functor RangeBound | |
Eq a => Eq (RangeBound a) | |
Show a => Show (RangeBound a) | |
Typeable (* -> *) RangeBound |
Generic range type
PGRange !(RangeBound a) !(RangeBound a) |
Functor PGRange | |
Ord a => Eq (PGRange a) | |
Show a => Show (PGRange a) | |
(FromField a, Typeable * a) => FromField (PGRange a) | |
ToField (PGRange Double) | |
ToField (PGRange Float) | |
ToField (PGRange Int) | |
ToField (PGRange Int8) | |
ToField (PGRange Int16) | |
ToField (PGRange Int32) | |
ToField (PGRange Int64) | |
ToField (PGRange Integer) | |
ToField (PGRange Word) | |
ToField (PGRange Word8) | |
ToField (PGRange Word16) | |
ToField (PGRange Word32) | |
ToField (PGRange Word64) | |
ToField (PGRange Scientific) | |
ToField (PGRange UTCTime) | |
ToField (PGRange LocalTime) | |
ToField (PGRange ZonedTime) | |
ToField (PGRange TimeOfDay) | |
ToField (PGRange NominalDiffTime) | |
ToField (PGRange Day) | |
ToField (PGRange Date) | |
ToField (PGRange ZonedTimestamp) | |
ToField (PGRange UTCTimestamp) | |
ToField (PGRange LocalTimestamp) | |
Typeable (* -> *) PGRange |
contains :: Ord a => PGRange a -> a -> Bool Source
Does a range contain a given point? Note that in some cases, this may
not correspond exactly with a server-side computation. Consider UTCTime
for example, which has a resolution of a picosecond, whereas postgresql's
timestamptz
types have a resolution of a microsecond. Putting such
Haskell values into the database will result in them being rounded, which
can change the value of the containment predicate.
containsBy :: (a -> a -> Ordering) -> PGRange a -> a -> Bool Source