From b8d517c103b549f440f29fec8d0a33ee4f6bf918 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Tue, 3 Sep 2013 20:25:44 +0900 Subject: [PATCH] Fix types of exists and listQuery operators. --- .../src/Database/Relational/Query/Projectable.hs | 2 +- relational-join/src/Database/Relational/Query/Relation.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/relational-join/src/Database/Relational/Query/Projectable.hs b/relational-join/src/Database/Relational/Query/Projectable.hs index b3142bc3..26ce3596 100644 --- a/relational-join/src/Database/Relational/Query/Projectable.hs +++ b/relational-join/src/Database/Relational/Query/Projectable.hs @@ -237,7 +237,7 @@ not = unsafeUniOp SQLs.not -- | Logical operator corresponding SQL /EXISTS/ . exists :: (SqlProjectable p, ProjectableShowSql p) - => ListProjection (Projection Exists) (Maybe Bool) -> p (Maybe Bool) + => ListProjection (Projection Exists) r -> p (Maybe Bool) exists = unsafeProjectSql . paren . SQLs.defineUniOp SQL.EXISTS . unsafeShowSqlListProjection unsafeShowSql diff --git a/relational-join/src/Database/Relational/Query/Relation.hs b/relational-join/src/Database/Relational/Query/Relation.hs index 5f8fdc46..9279a16f 100644 --- a/relational-join/src/Database/Relational/Query/Relation.hs +++ b/relational-join/src/Database/Relational/Query/Relation.hs @@ -116,15 +116,15 @@ queryMaybe' pr = do queryMaybe :: MonadQualify Qualify m => Relation () r -> m (Projection Flat (Maybe r)) queryMaybe = fmap snd . queryMaybe' -queryList0 :: Relation p r -> ListProjection (Projection Flat) r +queryList0 :: Relation p r -> ListProjection (Projection c) r queryList0 = unsafeListProjectionFromSubQuery . evalQualifyPrime . subQueryQualifyFromRelation -- | List subQuery, for /IN/ and /EXIST/ with place-holder parameter 'p'. -queryList' :: Relation p r -> (PlaceHolders p, ListProjection (Projection Flat) r) +queryList' :: Relation p r -> (PlaceHolders p, ListProjection (Projection c) r) queryList' = placeHoldersFromRelation &&& queryList0 -- | List subQuery, for /IN/ and /EXIST/. -queryList :: Relation () r -> ListProjection (Projection Flat) r +queryList :: Relation () r -> ListProjection (Projection c) r queryList = queryList0 -- | Finalize 'QuerySimple' monad and generate 'Relation'.