Copyright | (c) 2014-2015 Leonid Onokhov (c) 2014-2015 Leon P Smith |
---|---|
License | BSD3 |
Maintainer | Leon P Smith <leon@melding-monads.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- 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
- fromFieldRange :: Typeable a => FieldParser a -> FieldParser (PGRange a)
Documentation
data RangeBound a Source #
Represents boundary of a range
Instances
Functor RangeBound Source # | |
Defined in Database.PostgreSQL.Simple.Range fmap :: (a -> b) -> RangeBound a -> RangeBound b # (<$) :: a -> RangeBound b -> RangeBound a # | |
Show a => Show (RangeBound a) Source # | |
Defined in Database.PostgreSQL.Simple.Range showsPrec :: Int -> RangeBound a -> ShowS # show :: RangeBound a -> String # showList :: [RangeBound a] -> ShowS # | |
Eq a => Eq (RangeBound a) Source # | |
Defined in Database.PostgreSQL.Simple.Range (==) :: RangeBound a -> RangeBound a -> Bool # (/=) :: RangeBound a -> RangeBound a -> Bool # |
Generic range type
PGRange !(RangeBound a) !(RangeBound a) |
Instances
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.
fromFieldRange :: Typeable a => FieldParser a -> FieldParser (PGRange a) Source #