@@ -39,6 +39,25 @@ module Squeal.PostgreSQL.Expression.Range
3939 , singleton, whole
4040 , Bound (..)
4141 , closed, open
42+ , (<@.)
43+ , (@>.)
44+ , (&&.)
45+ , (<<.)
46+ , (>>.)
47+ , (&<.)
48+ , (&>.)
49+ , (=|=.)
50+ , (+.)
51+ , (*.)
52+ , (-.)
53+ , lowerBound
54+ , upperBound
55+ , isEmpty
56+ , lowerInc
57+ , lowerInf
58+ , upperInc
59+ , upperInf
60+ , rangeMerge
4261 ) where
4362
4463import Data.Bool
@@ -112,3 +131,61 @@ singleton x = x <=..<= x
112131
113132whole :: Range x
114133whole = NonEmpty (open Nothing) (open Nothing)
134+
135+(<@.) :: Operator ('NotNull ty) (null ('PGrange ty)) ('Null 'PGbool)
136+(<@.) = unsafeBinaryOp "<@"
137+
138+(@>.) :: Operator (null ('PGrange ty)) ('NotNull ty) ('Null 'PGbool)
139+(@>.) = unsafeBinaryOp "<@"
140+
141+(&&.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
142+(&&.) = unsafeBinaryOp "&&"
143+
144+(<<.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
145+(<<.) = unsafeBinaryOp "<<"
146+
147+(>>.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
148+(>>.) = unsafeBinaryOp ">>"
149+
150+(&<.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
151+(&<.) = unsafeBinaryOp "&<"
152+
153+(&>.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
154+(&>.) = unsafeBinaryOp "&>"
155+
156+(=|=.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
157+(=|=.) = unsafeBinaryOp "&>"
158+
159+(+.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
160+(+.) = unsafeBinaryOp "+"
161+
162+(*.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
163+(*.) = unsafeBinaryOp "*"
164+
165+(-.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
166+(-.) = unsafeBinaryOp "-"
167+
168+lowerBound :: null ('PGrange ty) :--> null ty
169+lowerBound = unsafeFunction "lower"
170+
171+upperBound :: null ('PGrange ty) :--> null ty
172+upperBound = unsafeFunction "upper"
173+
174+isEmpty :: null ('PGrange ty) :--> 'Null 'PGbool
175+isEmpty = unsafeFunction "isempty"
176+
177+lowerInc :: null ('PGrange ty) :--> 'Null 'PGbool
178+lowerInc = unsafeFunction "lower_inc"
179+
180+lowerInf :: null ('PGrange ty) :--> 'Null 'PGbool
181+lowerInf = unsafeFunction "lower_inf"
182+
183+upperInc :: null ('PGrange ty) :--> 'Null 'PGbool
184+upperInc = unsafeFunction "upper_inc"
185+
186+upperInf :: null ('PGrange ty) :--> 'Null 'PGbool
187+upperInf = unsafeFunction "upper_inf"
188+
189+rangeMerge :: FunctionN
190+ '[ null ('PGrange ty), null ('PGrange ty)] (null ('PGrange ty))
191+rangeMerge = unsafeFunctionN "range_merge"