on dev help sign in
haddock fixes
commit91a5653ebfa69f3932790186a0fb2ac351b93509 authorEitan Chatav <eitan@Eitans-MacBook-Pro.local> dateFri 1 Mar 2019, 21:00 (8 years ago) parent392022c
6 files changed+20−20
squeal-postgresql/src/Squeal/PostgreSQL.hs+2−2 squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+1−1 squeal-postgresql/src/Squeal/PostgreSQL/PQ.hs+14−14 squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+1−1 squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+1−1 squeal-postgresql/src/Squeal/PostgreSQL/Transaction.hs+1−1
squeal-postgresql/src/Squeal/PostgreSQL.hs+2−2
@@ -13,7 +13,7 @@ features.
1313
1414>>> :set -XDataKinds -XDeriveGeneric -XOverloadedLabels
1515>>> :set -XOverloadedStrings -XTypeApplications -XTypeOperators -XGADTs
16−
16+
1717We'll need some imports.
1818
1919>>> import Control.Monad (void)
@@ -105,7 +105,7 @@ DROP TABLE "emails";
105105DROP TABLE "users";
106106
107107Next, we'll write `Manipulation`s to insert data into our two tables.
108−A `Manipulation` like `insertRow`, `update` or `deleteFrom`
108+A `Manipulation` like `insertInto`, `update` or `deleteFrom`
109109has three type parameters, the schema it refers to, a list of parameters
110110it can take as input, and a list of columns it produces as output. When
111111we insert into the users table, we will need a parameter for the @name@
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+1−1
@@ -47,7 +47,7 @@ void . withConnection "host=localhost port=5432 dbname=exampledb" $ do
4747True
4848
4949In addition to being able to encode and decode basic Haskell types
50−like `Int16` and `Text`, Squeal permits you to encode and decode Haskell types to
50+like `Int16` and `Data.Text.Text`, Squeal permits you to encode and decode Haskell types to
5151Postgres array, enumerated and composite types and json. Let's see another example,
5252this time using the `Vector` type which corresponds to variable length arrays
5353and homogeneous tuples which correspond to fixed length arrays. We can even
squeal-postgresql/src/Squeal/PostgreSQL/PQ.hs+14−14
@@ -6,7 +6,7 @@ Maintainer: eitan@morphism.tech
66Stability: experimental
77
88This module is where Squeal commands actually get executed by
9−`LibPQ`. It containts two typeclasses, `IndexedMonadTransPQ` for executing
9+`Database.PostgreSQL.LibPQ`. It containts two typeclasses, `IndexedMonadTransPQ` for executing
1010a `Definition` and `MonadPQ` for executing a `Manipulation` or `Query`,
1111and a `PQ` type with instances for them.
1212
@@ -172,7 +172,7 @@ instance Monad m => Functor (PQ schemas0 schemas1 m) where
172172 K x <- pq conn
173173 return $ K (f x)
174174
175−-- | Run a `PQ` and keep the result and the `Connection`.
175+-- | Run a `PQ` and keep the result and the `LibPQ.Connection`.
176176runPQ
177177 :: Functor m
178178 => PQ schemas0 schemas1 m x
@@ -182,7 +182,7 @@ runPQ (PQ pq) conn = (\ x -> (unK x, K (unK conn))) <$> pq conn
182182 -- K x <- pq conn
183183 -- return (x, K (unK conn))
184184
185−-- | Execute a `PQ` and discard the result but keep the `Connection`.
185+-- | Execute a `PQ` and discard the result but keep the `LibPQ.Connection`.
186186execPQ
187187 :: Functor m
188188 => PQ schemas0 schemas1 m x
@@ -190,7 +190,7 @@ execPQ
190190 -> m (K LibPQ.Connection schemas1)
191191execPQ (PQ pq) conn = mapKK (\ _ -> unK conn) <$> pq conn
192192
193−-- | Evaluate a `PQ` and discard the `Connection` but keep the result.
193+-- | Evaluate a `PQ` and discard the `LibPQ.Connection` but keep the result.
194194evalPQ
195195 :: Functor m
196196 => PQ schemas0 schemas1 m x
@@ -279,8 +279,8 @@ instance IndexedMonadTransPQ PQ where
279279 "define: LibPQ.exec returned no results"
280280 Just result -> return $ K (K result)
281281
282−{- | `MonadPQ` is an `mtl` style constraint, similar to
283−`Control.Monad.State.Class.MonadState`, for using `LibPQ` to
282+{- | `MonadPQ` is an @mtl@ style constraint, similar to
283+`Control.Monad.State.Class.MonadState`, for using `Database.PostgreSQL.LibPQ` to
284284
285285* `manipulateParams` runs a `Manipulation` with params from a type
286286 with a `ToParams` constraint. It calls `LibPQ.execParams` and
@@ -305,7 +305,7 @@ instance IndexedMonadTransPQ PQ where
305305
306306* `forPrepared_` is a flipped `traversePrepared_`.
307307
308−* `liftPQ` lets you lift actions from `LibPQ` that require a connection
308+* `liftPQ` lets you lift actions from `Database.PostgreSQL.LibPQ` that require a connection
309309 into your monad.
310310
311311To define an instance, you can minimally define only `manipulateParams`,
@@ -317,13 +317,13 @@ class Monad pq => MonadPQ schemas pq | pq -> schemas where
317317 manipulateParams
318318 :: ToParams x params
319319 => Manipulation '[] schemas params ys
320− -- ^ `insertRows`, `update` or `deleteFrom`
320+ -- ^ `insertInto`, `update` or `deleteFrom`
321321 -> x -> pq (K LibPQ.Result ys)
322322 default manipulateParams
323323 :: (MonadTrans t, MonadPQ schemas pq1, pq ~ t pq1)
324324 => ToParams x params
325325 => Manipulation '[] schemas params ys
326− -- ^ `insertRows`, `update` or `deleteFrom`
326+ -- ^ `insertInto`, `update` or `deleteFrom`
327327 -> x -> pq (K LibPQ.Result ys)
328328 manipulateParams manipulation params = lift $
329329 manipulateParams manipulation params
@@ -347,7 +347,7 @@ class Monad pq => MonadPQ schemas pq | pq -> schemas where
347347 traversePrepared
348348 :: (ToParams x params, Traversable list)
349349 => Manipulation '[] schemas params ys
350− -- ^ `insertRows`, `update`, or `deleteFrom`, and friends
350+ -- ^ `insertInto`, `update`, or `deleteFrom`, and friends
351351 -> list x -> pq (list (K LibPQ.Result ys))
352352 default traversePrepared
353353 :: (MonadTrans t, MonadPQ schemas pq1, pq ~ t pq1)
@@ -360,20 +360,20 @@ class Monad pq => MonadPQ schemas pq | pq -> schemas where
360360 :: (ToParams x params, Traversable list)
361361 => list x
362362 -> Manipulation '[] schemas params ys
363− -- ^ `insertRows`, `update` or `deleteFrom`
363+ -- ^ `insertInto`, `update` or `deleteFrom`
364364 -> pq (list (K LibPQ.Result ys))
365365 forPrepared = flip traversePrepared
366366
367367 traversePrepared_
368368 :: (ToParams x params, Foldable list)
369369 => Manipulation '[] schemas params '[]
370− -- ^ `insertRows`, `update` or `deleteFrom`
370+ -- ^ `insertInto`, `update` or `deleteFrom`
371371 -> list x -> pq ()
372372 default traversePrepared_
373373 :: (MonadTrans t, MonadPQ schemas pq1, pq ~ t pq1)
374374 => (ToParams x params, Foldable list)
375375 => Manipulation '[] schemas params '[]
376− -- ^ `insertRows`, `update` or `deleteFrom`
376+ -- ^ `insertInto`, `update` or `deleteFrom`
377377 -> list x -> pq ()
378378 traversePrepared_ manipulation params = lift $
379379 traversePrepared_ manipulation params
@@ -382,7 +382,7 @@ class Monad pq => MonadPQ schemas pq | pq -> schemas where
382382 :: (ToParams x params, Foldable list)
383383 => list x
384384 -> Manipulation '[] schemas params '[]
385− -- ^ `insertRows`, `update` or `deleteFrom`
385+ -- ^ `insertInto`, `update` or `deleteFrom`
386386 -> pq ()
387387 forPrepared_ = flip traversePrepared_
388388
squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+1−1
@@ -107,7 +107,7 @@ instance Monad m => Monad (PoolPQ schemas m) where
107107 x' <- x pool
108108 runPoolPQ (f x') pool
109109
110−-- | `MonadFail` instance for `PoolPQ`.
110+-- | `Fail.MonadFail` instance for `PoolPQ`.
111111instance Monad m => Fail.MonadFail (PoolPQ schemas m) where
112112 fail = Fail.fail
113113
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+1−1
@@ -289,7 +289,7 @@ type family Uniquely
289289type TableType = (TableConstraints,ColumnsType)
290290
291291{- | A `RowType` is a row of `NullityType`. They correspond to Haskell
292−record types by means of `RowPG` and are used in many places.
292+record types by means of `Squeal.PostgreSQL.Binary.RowPG` and are used in many places.
293293
294294>>> :{
295295type family PersonRow :: RowType where
squeal-postgresql/src/Squeal/PostgreSQL/Transaction.hs+1−1
@@ -92,7 +92,7 @@ transactionallySchema mode u = PQ $ \ conn -> mask $ \ restore -> do
9292 _ <- liftBase $ LibPQ.exec (unK conn) "COMMIT"
9393 return x
9494
95−-- | Run a schema changing computation `transactionallySchema_` in `DefaultMode`.
95+-- | Run a schema changing computation `transactionallySchema_` in `defaultMode`.
9696transactionallySchema_
9797 :: MonadBaseControl IO io
9898 => PQ schemas0 schemas1 io x