postgresql-simple-0.5.3.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
LanguageHaskell98

Database.PostgreSQL.Simple.Range

Description

 

Synopsis

Documentation

data RangeBound a #

Represents boundary of a range

Instances

Functor RangeBound # 

Methods

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

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

Eq a => Eq (RangeBound a) # 

Methods

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

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

Show a => Show (RangeBound a) # 

data PGRange a #

Generic range type

Constructors

PGRange !(RangeBound a) !(RangeBound a) 

Instances

Functor PGRange # 

Methods

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

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

Ord a => Eq (PGRange a) # 

Methods

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

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

Show a => Show (PGRange a) # 

Methods

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

show :: PGRange a -> String #

showList :: [PGRange a] -> ShowS #

(FromField a, Typeable * a) => FromField (PGRange a) # 
ToField (PGRange Double) # 
ToField (PGRange Float) # 
ToField (PGRange Int) # 

Methods

toField :: PGRange Int -> Action #

ToField (PGRange Int8) # 

Methods

toField :: PGRange Int8 -> Action #

ToField (PGRange Int16) # 
ToField (PGRange Int32) # 
ToField (PGRange Int64) # 
ToField (PGRange Integer) # 
ToField (PGRange Word) # 

Methods

toField :: PGRange Word -> Action #

ToField (PGRange Word8) # 
ToField (PGRange Word16) # 
ToField (PGRange Word32) # 
ToField (PGRange Word64) # 
ToField (PGRange Scientific) # 
ToField (PGRange UTCTime) # 
ToField (PGRange LocalTime) # 
ToField (PGRange ZonedTime) # 
ToField (PGRange TimeOfDay) # 
ToField (PGRange NominalDiffTime) # 
ToField (PGRange Day) # 

Methods

toField :: PGRange Day -> Action #

ToField (PGRange Date) # 

Methods

toField :: PGRange Date -> Action #

ToField (PGRange ZonedTimestamp) # 
ToField (PGRange UTCTimestamp) # 
ToField (PGRange LocalTimestamp) # 

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

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 #

contains :: Ord a => PGRange a -> a -> Bool #

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 #