on dev help sign in
fix tests & haddocks
commit9d8d46e05c89084b4836b42760c2dcdaca992163 authorEitan Chatav <eitan@Eitans-MacBook-Pro.local> dateFri 1 Mar 2019, 14:08 (8 years ago) parentbf722d1
2 files changed+14−12
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+9−9 squeal-postgresql/src/Squeal/PostgreSQL/Query.hs+5−3
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+9−9
@@ -1540,7 +1540,7 @@ class Aggregate expr1 expr2 aggr
15401540
15411541 >>> :{
15421542 let
1543− expression :: Expression '[] ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGbool]] (nullity 'PGbool)
1543+ expression :: Expression '[] ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGbool]] ('Null 'PGbool)
15441544 expression = boolOr (All #col)
15451545 in printSQL expression
15461546 :}
@@ -1556,7 +1556,7 @@ class Aggregate expr1 expr2 aggr
15561556
15571557 >>> :{
15581558 let
1559− expression :: Expression '[] ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGbool]] (nullity 'PGbool)
1559+ expression :: Expression '[] ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGbool]] ('Null 'PGbool)
15601560 expression = every (Distinct #col)
15611561 in printSQL expression
15621562 :}
@@ -1588,7 +1588,7 @@ class Aggregate expr1 expr2 aggr
15881588 {- | correlation coefficient
15891589 >>> :{
15901590 let
1591− expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1591+ expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)
15921592 expression = corr (All (#y :*: #x))
15931593 in printSQL expression
15941594 :}
@@ -1601,7 +1601,7 @@ class Aggregate expr1 expr2 aggr
16011601 {- | population covariance
16021602 >>> :{
16031603 let
1604− expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1604+ expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)
16051605 expression = covarPop (All (#y :*: #x))
16061606 in printSQL expression
16071607 :}
@@ -1614,7 +1614,7 @@ class Aggregate expr1 expr2 aggr
16141614 {- | sample covariance
16151615 >>> :{
16161616 let
1617− winFun :: WindowFunction '[] 'Ungrouped c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1617+ winFun :: WindowFunction '[] 'Ungrouped c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)
16181618 winFun = covarSamp (#y :*: #x)
16191619 in printSQL winFun
16201620 :}
@@ -1627,7 +1627,7 @@ class Aggregate expr1 expr2 aggr
16271627 {- | average of the independent variable (sum(X)/N)
16281628 >>> :{
16291629 let
1630− expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1630+ expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)
16311631 expression = regrAvgX (All (#y :*: #x))
16321632 in printSQL expression
16331633 :}
@@ -1640,7 +1640,7 @@ class Aggregate expr1 expr2 aggr
16401640 {- | average of the dependent variable (sum(Y)/N)
16411641 >>> :{
16421642 let
1643− winFun :: WindowFunction '[] 'Ungrouped c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1643+ winFun :: WindowFunction '[] 'Ungrouped c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)
16441644 winFun = regrAvgY (#y :*: #x)
16451645 in printSQL winFun
16461646 :}
@@ -1653,7 +1653,7 @@ class Aggregate expr1 expr2 aggr
16531653 {- | number of input rows in which both expressions are nonnull
16541654 >>> :{
16551655 let
1656− winFun :: WindowFunction '[] 'Ungrouped c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGint8)
1656+ winFun :: WindowFunction '[] 'Ungrouped c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGint8)
16571657 winFun = regrCount (#y :*: #x)
16581658 in printSQL winFun
16591659 :}
@@ -1666,7 +1666,7 @@ class Aggregate expr1 expr2 aggr
16661666 {- | y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs
16671667 >>> :{
16681668 let
1669− expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1669+ expression :: Expression '[] ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)
16701670 expression = regrIntercept (All (#y :*: #x))
16711671 in printSQL expression
16721672 :}
squeal-postgresql/src/Squeal/PostgreSQL/Query.hs+5−3
@@ -720,6 +720,7 @@ unsafeSetOfFunction
720720unsafeSetOfFunction fun expr = UnsafeQuery $
721721 "SELECT * FROM " <> fun <> "(" <> renderSQL expr <> ")"
722722
723+-- | Expand an array to a set of rows
723724unnest
724725 :: Expression outer 'Ungrouped commons schemas params '[] (nullity ('PGvararray ty))
725726 -> Query outer commons schemas params '[ "unnest" ::: ty ]
@@ -891,6 +892,7 @@ view
891892view (vw `As` alias) = UnsafeFromClause $
892893 renderSQL vw <+> "AS" <+> renderSQL alias
893894
895+-- | `common` derives a table from a common table expression.
894896common
895897 :: Has cte commons common
896898 => Aliased Alias (alias ::: cte)
@@ -1063,7 +1065,7 @@ instance RenderSQL (HavingClause outer grp commons schemas params from) where
10631065 Having conditions ->
10641066 " HAVING" <+> commaSeparated (renderSQL <$> conditions)
10651067
1066−{-
1068+{- |
10671069The argument of `exists` is an arbitrary subquery. The subquery is evaluated
10681070to determine whether it returns any rows. If it returns at least one row,
10691071the result of `exists` is `true`; if the subquery returns no rows,
@@ -1125,7 +1127,7 @@ subAny
11251127subAny expr (?) qry = expr ?
11261128 (UnsafeExpression $ "ANY" <+> parenthesized (renderSQL qry))
11271129
1128−{-
1130+{- |
11291131The result is `true` if the left-hand expression's result is equal
11301132to any of the right-hand expressions.
11311133
@@ -1139,7 +1141,7 @@ in_
11391141expr `in_` exprs = UnsafeExpression $ renderSQL expr <+> "IN"
11401142 <+> parenthesized (commaSeparated (renderSQL <$> exprs))
11411143
1142−{-
1144+{- |
11431145The result is `true` if the left-hand expression's result is not equal
11441146to any of the right-hand expressions.
11451147