postgresql-simple-0.5.0.1: 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 Source

Represents boundary of a range

Instances

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