Improve coding style a bit

This commit is contained in:
Tomasz Rybarczyk 2017-12-05 22:12:01 +01:00
parent 6a0f231eb7
commit f6f3328149
2 changed files with 3 additions and 5 deletions

View File

@ -67,7 +67,8 @@ foreign import ffiNewPool
. PoolConfiguration
-> Eff (postgreSQL :: POSTGRESQL | eff) Pool
-- | Run an action with a connection. The connection is released to the pool
-- | when the action returns.
withConnection
:: eff a
. Pool
@ -81,8 +82,6 @@ withConnection p k =
type PostgreSqlEff eff = (postgreSQL :: POSTGRESQL | eff)
-- | Run an action with a connection. The connection is released to the pool
-- | when the action returns.
connect
:: eff
. Pool
@ -102,7 +101,6 @@ foreign import ffiConnect
, done :: Eff (PostgreSqlEff eff) Unit
}
-- | Run an action within a transaction. The transaction is committed if the
-- | action returns, and rolled back when the action throws. If you want to
-- | change the transaction mode, issue a separate `SET TRANSACTION` statement

View File

@ -16,7 +16,7 @@ import Test.Assert (ASSERT, assert)
main :: eff. Eff (assert :: ASSERT, exception :: EXCEPTION, postgreSQL :: POSTGRESQL | eff) Unit
main = void $ launchAff do
pool <- newPool config
withConnection pool \conn do
withConnection pool \conn -> do
execute conn (Query """
CREATE TEMPORARY TABLE foods (
name text NOT NULL,