File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -2,21 +2,21 @@ module Catalog (catalog) where
22
33import Control.Arrow (second )
44import Control.Monad
5- import Control.Monad.Base
65import Control.Monad.Catch
6+ import Control.Monad.IO.Class
77import Data.Function
88import Data.Int
99import Data.Monoid.Utils
1010import Data.Pool
1111import Data.Text qualified as T
1212import Database.PostgreSQL.PQTypes
1313import Database.PostgreSQL.PQTypes.Internal.Utils (mread )
14- import System.Console.Readline
14+ import System.Console.Haskeline
1515import System.Environment
1616
1717-- | Generic 'putStrLn'.
18- printLn :: MonadBase IO m => String -> m ()
19- printLn = liftBase . putStrLn
18+ printLn :: MonadIO m => String -> m ()
19+ printLn = liftIO . putStrLn
2020
2121-- | Get connection string from command line argument.
2222getConnSettings :: IO ConnectionSettings
@@ -144,13 +144,12 @@ catalog = do
144144 cs <- getConnSettings
145145 withCatalog cs $ do
146146 ConnectionSource pool <- poolSource (cs {csComposites = [" book_" ]}) (\ connect disconnect -> defaultPoolConfig connect disconnect 1 10 )
147- fix $ \ next ->
148- readline " > "
147+ runInputT defaultSettings . fix $ \ next ->
148+ getInputLine " > "
149149 >>= maybe
150150 (printLn " " )
151151 ( \ cmd -> do
152152 when (cmd /= " quit" ) $ do
153- processCommand pool cmd
154- addHistory cmd
153+ liftIO $ processCommand pool cmd
155154 next
156155 )
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ test-suite hpqtypes-tests
196196 , monad-control >= 1.0.3
197197 , mtl >= 2.1
198198 , random >= 1.0
199- , readline >= 1.0.3 .0
199+ , haskeline >= 0.8.0 .0
200200 , resource-pool >= 0.4
201201 , scientific
202202 , test-framework >= 0.8
You can’t perform that action at this time.
0 commit comments