Permalink
Browse files

Clean up functions, don't let them print to the console

  • Loading branch information...
adomokos committed Dec 5, 2017
1 parent 3bb0761 commit f2b2393b437c32b669984d52f8195b1b9d643f95
Showing with 8 additions and 9 deletions.
  1. +8 −9 app/Main.hs
View
@@ -35,17 +35,16 @@ withConn f = do
H.disconnect conn
return result
insertClient :: String -> String -> IO ()
insertClient :: String -> String -> IO Integer
insertClient name subdomain = do
clientId <- withConn $ do insertClientSQL name subdomain
putStrLn $ "New client's id is " ++ show clientId
withConn $ do insertClientSQL name subdomain
countClient :: IO ()
countClient = do
Just (clientCount) <- withConn countClientSQL
putStrLn $ "There are " ++ show clientCount ++ " records."
countClient :: IO (Maybe Int)
countClient = do withConn countClientSQL
main :: IO ()
main = do
insertClient "TestClient" "testclient"
countClient
clientId <- insertClient "TestClient" "testclient"
putStrLn $ "New client's id is " ++ show clientId
Just clientCount <- countClient
putStrLn $ "There are " ++ show clientCount ++ " records."

0 comments on commit f2b2393

Please sign in to comment.