Skip to content

Commit

Permalink
Fix strict build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nzhang-zh committed Aug 21, 2020
1 parent 507ec51 commit 7bb67e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
4 changes: 1 addition & 3 deletions app/library/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

module Main where

import Control.Monad.IO.Class ( MonadIO
, liftIO
)
import Control.Monad.IO.Class ( liftIO )
import Control.Monad.Logger as L
import qualified Data.Text as T

Expand Down
16 changes: 6 additions & 10 deletions src/Demo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Demo where

import qualified Control.Exception.Safe as E
import Control.Exception.Safe ( MonadCatch
, MonadMask
, MonadThrow
)
import Control.Monad.IO.Class ( MonadIO
Expand All @@ -21,9 +20,6 @@ import Control.Monad.Reader ( MonadReader
, ask
, runReaderT
)
import Control.Monad.Trans.Class ( MonadTrans
, lift
)
import Data.Default.Class ( Default
, def
)
Expand Down Expand Up @@ -66,7 +62,7 @@ runDemo env demo = do
L.runStderrLoggingT $ runReaderT (runDemoT demo) env

warpApp :: Application
warpApp req respond = E.bracket_
warpApp _req respond = E.bracket_
(L.runStderrLoggingT ($(L.logInfo) "Try IO Block"))
(L.runStderrLoggingT ($(L.logInfo) "Clean IO Block"))
(respond $ Wai.responseLBS HTTP.status200
Expand All @@ -91,12 +87,12 @@ runDemoApp = do
demoHost <- lookupEnv "DEMO_HOST"
demoPort <- lookupEnv "DEMO_PORT"
let defaultEnv = def :: DemoEnv
defaultEnv <- return $ maybe
defaultEnv' <- return $ maybe
defaultEnv
(\host -> defaultEnv { demoEnvHost = read host })
demoHost
defaultEnv <- return $ maybe
defaultEnv
(\port -> defaultEnv { demoEnvPort = read port })
defaultEnv'' <- return $ maybe
defaultEnv'
(\port -> defaultEnv' { demoEnvPort = read port })
demoPort
runDemo defaultEnv demoApp
runDemo defaultEnv'' demoApp
3 changes: 0 additions & 3 deletions src/Library.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

module Library where

import Control.Monad.IO.Class ( MonadIO
, liftIO
)
import Control.Monad.Logger as L
import Control.Monad.Logger ( LoggingT
, MonadLogger
Expand Down

0 comments on commit 7bb67e5

Please sign in to comment.