@@ -17,7 +17,7 @@ features.
1717We'll need some imports.
1818
1919>>> import Control.Monad (void)
20−>>> import Control.Monad.Base (liftBase)
20+>>> import Control.Monad.IO.Class (liftIO)
2121>>> import Data.Int (Int32)
2222>>> import Data.Text (Text)
2323>>> import Squeal.PostgreSQL
@@ -60,7 +60,7 @@ yielding a `TableType`, or to pair a `ColumnConstraint` with a `NullityType`,
6060yielding a `ColumnType`. It is intended to connote Haskell's @=>@ operator
6161
6262Next, we'll write `Definition`s to set up and tear down the schema. In
63−Squeal, a `Definition` like `createTable`, `alterTable` or `dropTable`
63+Squeal, a `Definition` like `createTable`, `alterTable` or `dropTable`
6464has two type parameters, corresponding to the schema
6565before being run and the schema after. We can compose definitions using `>>>`.
6666Here and in the rest of our commands we make use of overloaded
@@ -69,7 +69,7 @@ labels to refer to named tables and columns in our schema.
6969>>> :{
7070let
7171 setup :: Definition (Public '[]) Schemas
72− setup =
72+ setup =
7373 createTable #users
7474 ( serial `as` #id :*
7575 (text & notNullable) `as` #name )
@@ -119,7 +119,7 @@ We'll need a Haskell type for users. We give the type `Generics.SOP.Generic` and
119119`Generics.SOP.HasDatatypeInfo` instances so that we can decode the rows
120120we receive when we run @getUsers@. Notice that the record fields of the
121121@User@ type match the column names of @getUsers@.
122−
122+
123123>>> data User = User { userName :: Text, userEmail :: Maybe Text } deriving (Show, GHC.Generic)
124124>>> instance SOP.Generic User
125125>>> instance SOP.HasDatatypeInfo User
@@ -162,7 +162,7 @@ Let's create some users to add to the database.
162162>>> :{
163163let
164164 users :: [User]
165− users =
165+ users =
166166 [ User "Alice" (Just "alice@gmail.com")
167167 , User "Bob" Nothing
168168 , User "Carole" (Just "carole@hotmail.com")
@@ -184,7 +184,7 @@ let
184184 _ <- traversePrepared_ insertUser users
185185 usersResult <- runQuery getUsers
186186 usersRows <- getRows usersResult
187− liftBase $ print (usersRows :: [User])
187+ liftIO $ print (usersRows :: [User])
188188in
189189 void . withConnection "host=localhost port=5432 dbname=exampledb" $
190190 define setup