postgresql-simple-0.6.5: 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 HaskellSafe-Inferred
LanguageHaskell2010

Database.PostgreSQL.Simple.Range

Description

 
Synopsis

Documentation

data RangeBound a Source #

Represents boundary of a range

Instances

Instances details
Functor RangeBound Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

Methods

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

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

Show a => Show (RangeBound a) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

Eq a => Eq (RangeBound a) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

Methods

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

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

data PGRange a Source #

Generic range type

Constructors

PGRange !(RangeBound a) !(RangeBound a) 

Instances

Instances details
Functor PGRange Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

Methods

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

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

Show a => Show (PGRange a) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

Methods

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

show :: PGRange a -> String #

showList :: [PGRange a] -> ShowS #

Ord a => Eq (PGRange a) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

Methods

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

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

(FromField a, Typeable a) => FromField (PGRange a) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Int16) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Int32) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Int64) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Int8) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Word16) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Word32) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Word64) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Word8) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Date) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange LocalTimestamp) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange UTCTimestamp) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange ZonedTimestamp) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Scientific) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Day) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange NominalDiffTime) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange UTCTime) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange LocalTime) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange TimeOfDay) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange ZonedTime) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Integer) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Double) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Float) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Int) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

ToField (PGRange Word) Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Range

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 #