postgresql-simple-0.5.4.0: Mid-Level PostgreSQL client library

Copyright(c) 2014-2015 Leonid Onokhov
(c) 2014-2015 Leon P Smith
LicenseBSD3
MaintainerLeon P Smith <leon@melding-monads.com>
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Simple.Range

Description

 

Synopsis

Documentation

data RangeBound a Source #

Represents boundary of a range

Instances

Functor RangeBound Source # 

Methods

fmap :: (a -> b) -> RangeBound a -> RangeBound b #

(<$) :: a -> RangeBound b -> RangeBound a #

Eq a => Eq (RangeBound a) Source # 

Methods

(==) :: RangeBound a -> RangeBound a -> Bool #

(/=) :: RangeBound a -> RangeBound a -> Bool #

Show a => Show (RangeBound a) Source # 

data PGRange a Source #

Generic range type

Constructors

PGRange !(RangeBound a) !(RangeBound a) 

Instances

Functor PGRange Source # 

Methods

fmap :: (a -> b) -> PGRange a -> PGRange b #

(<$) :: a -> PGRange b -> PGRange a #

Ord a => Eq (PGRange a) Source # 

Methods

(==) :: PGRange a -> PGRange a -> Bool #

(/=) :: PGRange a -> PGRange a -> Bool #

Show a => Show (PGRange a) Source # 

Methods

showsPrec :: Int -> PGRange a -> ShowS #

show :: PGRange a -> String #

showList :: [PGRange a] -> ShowS #

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 ZonedTime) Source # 
ToField (PGRange LocalTime) 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 # 
(FromField a, Typeable * a) => FromField (PGRange a) Source # 

isEmpty :: Ord a => PGRange a -> Bool Source #

Is a range empty? If this returns True, then the contains predicate will always return False. However, if this returns False, it is not necessarily true that there exists a point for which contains returns True. Consider PGRange (Excludes 2) (Excludes 3) :: PGRange Int, for example.

isEmptyBy :: (a -> a -> Ordering) -> PGRange a -> Bool 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 #