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 Source # | |
Eq a => Eq (RangeBound a) Source # | |
Show a => Show (RangeBound a) Source # | |
Generic range type
PGRange !(RangeBound a) !(RangeBound a) |
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.