Module

Data.Postgres.Range

Package
purescript-postgresql
Repository
cakekindel/purescript-postgresql

#Range Source

newtype Range a

A range of values with optional upper & lower bounds.

  • mempty -> '(,)'
  • gte 1 -> '[1,)'
  • lt 2 -> '(,2]'
  • gte 1 <> lt 2 -> '[1,2)'

Constructors

Instances

#Bound Source

data Bound a

An upper or lower range bound

Constructors

Instances

#boundValue Source

boundValue :: forall a. Bound a -> a

Get the value of the bound

#boundIsInclusive Source

boundIsInclusive :: forall a. Bound a -> Boolean

Whether this bound includes the value a

#upper Source

upper :: forall a. Range a -> Maybe (Bound a)

The upper bound of a range

#lower Source

lower :: forall a. Range a -> Maybe (Bound a)

The lower bound of a range

#makeBound Source

makeBound :: forall a. Boolean -> a -> Bound a

Creates a bound from a bool indicating if the bound is inclusive and a value a

#contains Source

contains :: forall a. Ord a => a -> Range a -> Boolean

Returns whether the range contains value a

#gte Source

gte :: forall a. Ord a => a -> Range a

Creates a range with no upper bound and inclusive lower bound a; [a,)

#gt Source

gt :: forall a. Ord a => a -> Range a

Creates a range with no upper bound and exclusive lower bound a; (a,)

#lt Source

lt :: forall a. Ord a => a -> Range a

Creates a range with no lower bound and inclusive upper bound a; (,a]

#lte Source

lte :: forall a. Ord a => a -> Range a

Creates a range with no lower bound and exclusive upper bound a; (,a)

#RangeRecord Source

type RangeRecord = { lower :: Raw, lowerIncl :: Boolean, upper :: Raw, upperIncl :: Boolean }

FFI

#RangeRaw Source

data RangeRaw

FFI

#__rangeRawFromRaw Source

#__rangeRawToRecord Source

#__rangeRawFromRecord Source

#__rangeRawParse Source

#__rangeRawSerialize Source

#__rangeFromRecord Source

#__rangeToRecord Source