on dev help sign in
devoid
65dca81Eitan Chatav
squeal-postgresql/exe/Example.hs+1−2
@@ -11,7 +11,6 @@
11
11
12module Main (main, main2) where
12module Main (main, main2) where
13
13
14−import Control.Monad (void)
15import Control.Monad.IO.Class (MonadIO (..))
14import Control.Monad.IO.Class (MonadIO (..))
16import Data.Int (Int16, Int32)
15import Data.Int (Int16, Int32)
17import Data.Monoid ((<>))
16import Data.Monoid ((<>))
@@ -117,7 +116,7 @@ main = do
117
116
118main2 :: IO ()
117main2 :: IO ()
119main2 =
118main2 =
120− void . withConnection "host=localhost port=5432 dbname=exampledb" $
119+ withConnection "host=localhost port=5432 dbname=exampledb" $
121 define setup
120 define setup
122 & pqThen session
121 & pqThen session
123 & pqThen (define teardown)
122 & pqThen (define teardown)
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+3−3
@@ -39,7 +39,7 @@ the input and output should be equal.
39
39
40>>> let input = Row 2 "hi" (Just True)
40>>> let input = Row 2 "hi" (Just True)
41>>> :{
41>>> :{
42−void . withConnection "host=localhost port=5432 dbname=exampledb" $ do
42+withConnection "host=localhost port=5432 dbname=exampledb" $ do
43 result <- runQueryParams roundTrip input
43 result <- runQueryParams roundTrip input
44 Just output <- firstRow result
44 Just output <- firstRow result
45 liftIO . print $ input == output
45 liftIO . print $ input == output
@@ -78,7 +78,7 @@ let
78>>> :set -XOverloadedLists
78>>> :set -XOverloadedLists
79>>> let input = Row (VarArray [1,2]) (FixArray (Just 1,Nothing)) (FixArray ((1,2),(3,4),(5,6)))
79>>> let input = Row (VarArray [1,2]) (FixArray (Just 1,Nothing)) (FixArray ((1,2),(3,4),(5,6)))
80>>> :{
80>>> :{
81−void . withConnection "host=localhost port=5432 dbname=exampledb" $ do
81+withConnection "host=localhost port=5432 dbname=exampledb" $ do
82 result <- runQueryParams roundTrip input
82 result <- runQueryParams roundTrip input
83 Just output <- firstRow result
83 Just output <- firstRow result
84 liftIO . print $ input == output
84 liftIO . print $ input == output
@@ -170,7 +170,7 @@ let
170 Just output <- firstRow result
170 Just output <- firstRow result
171 liftIO . print $ input == output
171 liftIO . print $ input == output
172in
172in
173− void . withConnection "host=localhost port=5432 dbname=exampledb" $
173+ withConnection "host=localhost port=5432 dbname=exampledb" $
174 define setup
174 define setup
175 & pqThen session
175 & pqThen session
176 & pqThen (define teardown)
176 & pqThen (define teardown)
squeal-postgresql/src/Squeal/PostgreSQL/PG.hs+1−1
@@ -320,7 +320,7 @@ let
320>>> let input = Only (Money 20020)
320>>> let input = Only (Money 20020)
321
321
322>>> :{
322>>> :{
323−void . withConnection "host=localhost port=5432 dbname=exampledb" $ do
323+withConnection "host=localhost port=5432 dbname=exampledb" $ do
324 result <- runQueryParams roundTrip input
324 result <- runQueryParams roundTrip input
325 Just output <- firstRow result
325 Just output <- firstRow result
326 liftIO . print $ input == output
326 liftIO . print $ input == output
squeal-postgresql/test/Specs/ExceptionHandling.hs+2−3
@@ -24,7 +24,6 @@ import Data.Vector (Vector)
24import qualified Generics.SOP as SOP
24import qualified Generics.SOP as SOP
25import qualified GHC.Generics as GHC
25import qualified GHC.Generics as GHC
26import Squeal.PostgreSQL
26import Squeal.PostgreSQL
27−import Squeal.PostgreSQL.Migration
28import Test.Hspec
27import Test.Hspec
29
28
30type Schema =
29type Schema =
@@ -88,12 +87,12 @@ migration = Migration { name = "test"
88 , down = teardown }
87 , down = teardown }
89
88
90setupDB :: IO ()
89setupDB :: IO ()
91−setupDB = void . withConnection connectionString $
90+setupDB = withConnection connectionString $
92 manipulate (UnsafeManipulation "SET client_min_messages TO WARNING;")
91 manipulate (UnsafeManipulation "SET client_min_messages TO WARNING;")
93 & pqThen (migrateUp (single migration))
92 & pqThen (migrateUp (single migration))
94
93
95dropDB :: IO ()
94dropDB :: IO ()
96−dropDB = void . withConnection connectionString $
95+dropDB = withConnection connectionString $
97 manipulate (UnsafeManipulation "SET client_min_messages TO WARNING;")
96 manipulate (UnsafeManipulation "SET client_min_messages TO WARNING;")
98 & pqThen (migrateDown (single migration))
97 & pqThen (migrateDown (single migration))
99
98