postgresql-simple- Mid-Level PostgreSQL client library

Copyright(c) 2014-2015 Leonid Onokhov (c) 2014-2015 Leon P Smith
MaintainerLeon P Smith <>
Safe HaskellNone






data RangeBound a Source

Represents boundary of a 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