No title

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
offerServiceNegotiation :: (ConnectionSetup m,MonadIO m) =>
        TChan ServiceRequest -> TChan Frame -> State m Idle -> Either StateMachineException (State m Offered)

offerServiceNegotiation connectionTChan frameTchan idleState  =
            do
                let eitherEvent = (readEitherTChan connectionTChan frameTchan)
                -- e <- liftIO $ atomically $ readTChan connectionTChan -- eitherEvent
                e <- liftIO $ atomically $ eitherEvent


                if isLeft e
                    then
                        promptPrint "read session-request from the TChan"
                        -- promptPrint "create a new session, add to map"
                        -- promptPrint "send that Offer message out on the network"
                    else
                        promptPrint "Exception"
                let connection = "connection" :: ServiceRequest
                initServiceNegotiationEvent idleState connection
6:13: Warning: Redundant bracket
Found:
do let eitherEvent = (readEitherTChan connectionTChan frameTchan)
e <- liftIO $ atomically $ eitherEvent
if isLeft e then promptPrint "read session-request from the TChan"
else promptPrint "Exception"
let connection = "connection" :: ServiceRequest
initServiceNegotiationEvent idleState connection
Why not:
do let eitherEvent = readEitherTChan connectionTChan frameTchan
e <- liftIO $ atomically $ eitherEvent
if isLeft e then promptPrint "read session-request from the TChan"
else promptPrint "Exception"
let connection = "connection" :: ServiceRequest
initServiceNegotiationEvent idleState connection
9:31: Warning: Redundant $
Found:
atomically $ eitherEvent
Why not:
atomically eitherEvent