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) |
Functor PGRange Source | |
Ord a => Eq (PGRange a) Source | |
Show a => Show (PGRange a) Source | |
(FromField a, Typeable * a) => FromField (PGRange a) Source | |
ToField (PGRange Double) Source | |
ToField (PGRange Float) Source | |
ToField (PGRange Int) Source | |
ToField (PGRange Int8) Source | |
ToField (PGRange Int16) Source | |
ToField (PGRange Int32) Source | |
ToField (PGRange Int64) Source | |
ToField (PGRange Integer) Source | |
ToField (PGRange Word) Source | |
ToField (PGRange Word8) Source | |
ToField (PGRange Word16) Source | |
ToField (PGRange Word32) Source | |
ToField (PGRange Word64) Source | |
ToField (PGRange Scientific) Source | |
ToField (PGRange UTCTime) Source | |
ToField (PGRange LocalTime) Source | |
ToField (PGRange ZonedTime) Source | |
ToField (PGRange TimeOfDay) Source | |
ToField (PGRange NominalDiffTime) Source | |
ToField (PGRange Day) Source | |
ToField (PGRange Date) Source | |
ToField (PGRange ZonedTimestamp) Source | |
ToField (PGRange UTCTimestamp) Source | |
ToField (PGRange LocalTimestamp) Source |
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