on dev help sign in
docs
commitdcfd5bb6cae5a7a3b4fb12634a8a0def82edadb0 authorEitan Chatav <eitan.chatav@gmail.com> dateSat 17 Mar 2018, 16:37 (9 years ago) parent9f2c323
2 files changed+7
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+1 squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+6
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+1
@@ -336,6 +336,7 @@ foreignKey columns reftable refcolumns onDelete onUpdate =
336336 <+> renderOnDeleteClause onDelete
337337 <+> renderOnUpdateClause onUpdate
338338
339+-- | A type synonym for constraints on a table with a foreign key.
339340type ForeignKeyed schema table reftable subcolumns refsubcolumns
340341 = ( Has table schema reftable
341342 , SameTypes subcolumns refsubcolumns
squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+6
@@ -38,6 +38,7 @@ newtype PoolPQ (schema :: TablesType) m x =
3838 PoolPQ { runPoolPQ :: Pool (K Connection schema) -> m x }
3939 deriving Functor
4040
41+-- | `Applicative` instance for `PoolPQ`.
4142instance Monad m => Applicative (PoolPQ schema m) where
4243 pure x = PoolPQ $ \ _ -> pure x
4344 PoolPQ f <*> PoolPQ x = PoolPQ $ \ pool -> do
@@ -45,18 +46,22 @@ instance Monad m => Applicative (PoolPQ schema m) where
4546 x' <- x pool
4647 return $ f' x'
4748
49+-- | `Monad` instance for `PoolPQ`.
4850instance Monad m => Monad (PoolPQ schema m) where
4951 return = pure
5052 PoolPQ x >>= f = PoolPQ $ \ pool -> do
5153 x' <- x pool
5254 runPoolPQ (f x') pool
5355
56+-- | `MonadTrans` instance for `PoolPQ`.
5457instance MonadTrans (PoolPQ schema) where
5558 lift m = PoolPQ $ \ _pool -> m
5659
60+-- | `MonadBase` instance for `PoolPQ`.
5761instance MonadBase b m => MonadBase b (PoolPQ schema m) where
5862 liftBase = lift . liftBase
5963
64+-- | `MonadPQ` instance for `PoolPQ`.
6065instance MonadBaseControl IO io => MonadPQ schema (PoolPQ schema io) where
6166 manipulateParams manipulation params = PoolPQ $ \ pool -> do
6267 withResource pool $ \ conn -> do
@@ -88,6 +93,7 @@ poolpqliftWith :: Functor m => (PoolPQRun schema -> m a) -> PoolPQ schema m a
8893poolpqliftWith f = PoolPQ $ \ pool ->
8994 (f $ \ pq -> runPoolPQ pq pool)
9095
96+-- | `MonadBaseControl` instance for `PoolPQ`.
9197instance MonadBaseControl b m => MonadBaseControl b (PoolPQ schema m) where
9298 type StM (PoolPQ schema m) x = StM m x
9399 liftBaseWith f =