@@ -20,8 +20,9 @@ Stability: experimental
2020 , FunctionalDependencies
2121 , GADTs
2222 , LambdaCase
23− , OverloadedStrings
2423 , MultiParamTypeClasses
24+ , OverloadedStrings
25+ , PatternSynonyms
2526 , ScopedTypeVariables
2627 , TypeApplications
2728 , TypeFamilies
@@ -37,7 +38,7 @@ module Squeal.PostgreSQL.PG
3738 , NullPG
3839 , TuplePG
3940 , RowPG
40− -- * Storage newtypes
41+ -- * Storage types
4142 , Money (..)
4243 , Json (..)
4344 , Jsonb (..)
@@ -45,6 +46,9 @@ module Squeal.PostgreSQL.PG
4546 , Enumerated (..)
4647 , VarArray (..)
4748 , FixArray (..)
49+ , Bound (..)
50+ , pattern Closed
51+ , pattern Open
4852 -- * Type families
4953 , LabelsPG
5054 , DimPG
@@ -363,3 +367,14 @@ newtype FixArray arr = FixArray {getFixArray :: arr}
363367 deriving (Eq, Ord, Show, Read, GHC.Generic)
364368-- | `PGfixarray` @(@`DimPG` @hask) (@`FixPG` @hask)@
365369type instance PG (FixArray hask) = 'PGfixarray (DimPG hask) (FixPG hask)
370+
371+data Bound x = Bound
372+ { closedBound :: Bool
373+ , getBound :: Maybe x
374+ } deriving
375+ ( Eq, Ord, Show, Read, GHC.Generic
376+ , Functor, Foldable, Traversable )
377+pattern Closed, Open :: Maybe x -> Bound x
378+pattern Closed x = Bound True x
379+pattern Open x = Bound False x
380+type instance PG (Bound x, Bound x) = 'PGrange (PG x)