on dev help sign in
operator renaming
9a2cd8dEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+10−3
@@ -45,6 +45,7 @@ module Squeal.PostgreSQL.Expression
45 , FunctionN
45 , FunctionN
46 , unsafeFunctionN
46 , unsafeFunctionN
47 , PGSubset (..)
47 , PGSubset (..)
48+ , PGIntersect (..)
48 -- * Re-export
49 -- * Re-export
49 , (&)
50 , (&)
50 , K (..)
51 , K (..)
@@ -353,16 +354,22 @@ instance (ty `In` PGNum, ty `In` PGFloating) => Floating
353 atanh x = log ((1 + x) / (1 - x)) / 2
354 atanh x = log ((1 + x) / (1 - x)) / 2
354
355
355-- | Contained by operators
356-- | Contained by operators
356−class PGSubset subset where
357+class PGSubset ty where
357− (@>) :: Operator (null0 subset) (null1 subset) ('Null 'PGbool)
358+ (@>) :: Operator (null0 ty) (null1 ty) ('Null 'PGbool)
358 (@>) = unsafeBinaryOp "@>"
359 (@>) = unsafeBinaryOp "@>"
359− (<@) :: Operator (null0 subset) (null1 subset) ('Null 'PGbool)
360+ (<@) :: Operator (null0 ty) (null1 ty) ('Null 'PGbool)
360 (<@) = unsafeBinaryOp "<@"
361 (<@) = unsafeBinaryOp "<@"
361instance PGSubset 'PGjsonb
362instance PGSubset 'PGjsonb
362instance PGSubset 'PGtsquery
363instance PGSubset 'PGtsquery
363instance PGSubset ('PGvararray ty)
364instance PGSubset ('PGvararray ty)
364instance PGSubset ('PGrange ty)
365instance PGSubset ('PGrange ty)
365
366
367+class PGIntersect ty where
368+ (@&&) :: Operator (null0 ty) (null1 ty) ('Null 'PGbool)
369+ (@&&) = unsafeBinaryOp "&&"
370+instance PGIntersect ('PGvararray ty)
371+instance PGIntersect ('PGrange ty)
372+
366instance IsString
373instance IsString
367 (Expression outer commons grp schemas params from (null 'PGtext)) where
374 (Expression outer commons grp schemas params from (null 'PGtext)) where
368 fromString str = UnsafeExpression $
375 fromString str = UnsafeExpression $
squeal-postgresql/src/Squeal/PostgreSQL/Expression/Range.hs+27−31
@@ -38,17 +38,16 @@ module Squeal.PostgreSQL.Expression.Range
38 , moreThan, atLeast, lessThan, atMost
38 , moreThan, atLeast, lessThan, atMost
39 , singleton, whole
39 , singleton, whole
40 , Bound (..)
40 , Bound (..)
41− , (<@.)
41+ , (.<@)
42 , (@>.)
42 , (@>.)
43− , (&&.)
44− , (<<.)
43+ , (<<@)
45− , (>>.)
44+ , (@>>)
46− , (&<.)
45+ , (&<)
47− , (&>.)
46+ , (&>)
48− , (=|=.)
47+ , (-|-)
49− , (+.)
48+ , (@+)
50− , (*.)
49+ , (@*)
51− , (-.)
50+ , (@-)
52 , lowerBound
51 , lowerBound
53 , upperBound
52 , upperBound
54 , isEmpty
53 , isEmpty
@@ -128,38 +127,35 @@ singleton x = x <=..<= x
128whole :: Range x
127whole :: Range x
129whole = NonEmpty Infinite Infinite
128whole = NonEmpty Infinite Infinite
130
129
131−(<@.) :: Operator ('NotNull ty) (null ('PGrange ty)) ('Null 'PGbool)
130+(.<@) :: Operator ('NotNull ty) (null ('PGrange ty)) ('Null 'PGbool)
132−(<@.) = unsafeBinaryOp "<@"
131+(.<@) = unsafeBinaryOp "<@"
133
132
134(@>.) :: Operator (null ('PGrange ty)) ('NotNull ty) ('Null 'PGbool)
133(@>.) :: Operator (null ('PGrange ty)) ('NotNull ty) ('Null 'PGbool)
135(@>.) = unsafeBinaryOp "<@"
134(@>.) = unsafeBinaryOp "<@"
136
135
137−(&&.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
136+(<<@) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
138−(&&.) = unsafeBinaryOp "&&"
137+(<<@) = unsafeBinaryOp "<<"
139
138
140−(<<.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
139+(@>>) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
141−(<<.) = unsafeBinaryOp "<<"
140+(@>>) = unsafeBinaryOp ">>"
142
141
143−(>>.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
142+(&<) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
144−(>>.) = unsafeBinaryOp ">>"
143+(&<) = unsafeBinaryOp "&<"
145
144
146−(&<.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
145+(&>) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
147−(&<.) = unsafeBinaryOp "&<"
146+(&>) = unsafeBinaryOp "&>"
148
147
149−(&>.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
148+(-|-) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
150−(&>.) = unsafeBinaryOp "&>"
149+(-|-) = unsafeBinaryOp "-|-"
151
150
152−(=|=.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) ('Null 'PGbool)
151+(@+) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
153−(=|=.) = unsafeBinaryOp "&>"
152+(@+) = unsafeBinaryOp "+"
154
153
155−(+.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
154+(@*) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
156−(+.) = unsafeBinaryOp "+"
155+(@*) = unsafeBinaryOp "*"
157
156
158−(*.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
159−(*.) = unsafeBinaryOp "*"
160−
161−(-.) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
157+(@-) :: Operator (null ('PGrange ty)) (null ('PGrange ty)) (null ('PGrange ty))
162−(-.) = unsafeBinaryOp "-"
158+(@-) = unsafeBinaryOp "-"
163
159
164lowerBound :: null ('PGrange ty) :--> 'Null ty
160lowerBound :: null ('PGrange ty) :--> 'Null ty
165lowerBound = unsafeFunction "lower"
161lowerBound = unsafeFunction "lower"