on dev help sign in
generalize boolean operators
dc05f26Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+8−12
@@ -63,12 +63,12 @@ module Squeal.PostgreSQL.Expression
63 , greatest
63 , greatest
64 , least
64 , least
65 -- ** Conditions
65 -- ** Conditions
66− , Condition
67 , true
66 , true
68 , false
67 , false
69 , not_
68 , not_
70 , (.&&)
69 , (.&&)
71 , (.||)
70 , (.||)
71+ , Condition
72 , caseWhenThenElse
72 , caseWhenThenElse
73 , ifThenElse
73 , ifThenElse
74 , (.==)
74 , (.==)
@@ -89,10 +89,6 @@ module Squeal.PostgreSQL.Expression
89 , charLength
89 , charLength
90 , like
90 , like
91 -- ** json or jsonb operators
91 -- ** json or jsonb operators
92− , PGarray
93− , PGarrayOf
94− , PGjsonKey
95− , PGjson_
96 , (.->)
92 , (.->)
97 , (.->>)
93 , (.->>)
98 , (.#>)
94 , (.#>)
@@ -708,7 +704,7 @@ ceiling_
708ceiling_ = unsafeFunction "ceiling"
704ceiling_ = unsafeFunction "ceiling"
709
705
710-- | A `Condition` is an `Expression`, which can evaluate
706-- | A `Condition` is an `Expression`, which can evaluate
711−-- to `TRUE`, `FALSE` or `NULL`. This is because SQL uses
707+-- to `true`, `false` or `null_`. This is because SQL uses
712-- a three valued logic.
708-- a three valued logic.
713type Condition schema from grouping params =
709type Condition schema from grouping params =
714 Expression schema from grouping params ('Null 'PGbool)
710 Expression schema from grouping params ('Null 'PGbool)
@@ -733,18 +729,18 @@ not_ = unsafeUnaryOp "NOT"
733-- | >>> printSQL $ true .&& false
729-- | >>> printSQL $ true .&& false
734-- (TRUE AND FALSE)
730-- (TRUE AND FALSE)
735(.&&)
731(.&&)
736− :: Condition schema from grouping params
732+ :: Expression schema from grouping params (nullity 'PGbool)
737− -> Condition schema from grouping params
733+ -> Expression schema from grouping params (nullity 'PGbool)
738− -> Condition schema from grouping params
734+ -> Expression schema from grouping params (nullity 'PGbool)
739infixr 3 .&&
735infixr 3 .&&
740(.&&) = unsafeBinaryOp "AND"
736(.&&) = unsafeBinaryOp "AND"
741
737
742-- | >>> printSQL $ true .|| false
738-- | >>> printSQL $ true .|| false
743-- (TRUE OR FALSE)
739-- (TRUE OR FALSE)
744(.||)
740(.||)
745− :: Condition schema from grouping params
741+ :: Expression schema from grouping params (nullity 'PGbool)
746− -> Condition schema from grouping params
742+ -> Expression schema from grouping params (nullity 'PGbool)
747− -> Condition schema from grouping params
743+ -> Expression schema from grouping params (nullity 'PGbool)
748infixr 2 .||
744infixr 2 .||
749(.||) = unsafeBinaryOp "OR"
745(.||) = unsafeBinaryOp "OR"
750
746