From f6f3328149b98335139950581feca85d5dafeea8 Mon Sep 17 00:00:00 2001 From: Tomasz Rybarczyk Date: Tue, 5 Dec 2017 22:12:01 +0100 Subject: [PATCH] Improve coding style a bit --- src/Database/PostgreSQL.purs | 6 ++---- test/Main.purs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Database/PostgreSQL.purs b/src/Database/PostgreSQL.purs index e5b3053..6989147 100644 --- a/src/Database/PostgreSQL.purs +++ b/src/Database/PostgreSQL.purs @@ -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 diff --git a/test/Main.purs b/test/Main.purs index 4b873f6..5060f0b 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -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,