From 6eaaf3d8ce6025932990de6fa697d14c9651be76 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 24 Dec 2020 14:24:16 -0500 Subject: linting fixes and cleanup --- Biz/Que/Host.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Biz/Que') diff --git a/Biz/Que/Host.hs b/Biz/Que/Host.hs index 4817fd6..3668a29 100644 --- a/Biz/Que/Host.hs +++ b/Biz/Que/Host.hs @@ -63,7 +63,7 @@ main = Exception.bracket startup shutdown <| uncurry Warp.run putText <| "skey: " <> (show <| queSkey c) return (quePort c, waiapp) shutdown :: a -> IO a - shutdown = pure . identity + shutdown = pure <. identity newtype App a = App { runApp :: ReaderT (STM.TVar AppState) IO a @@ -129,9 +129,9 @@ routes cfg = do Scotty.get (Scotty.regex quepath) <| do (ns, qp) <- extract guardNs ns ["pub", "_"] - app . modify <| upsertNamespace ns + app <. modify <| upsertNamespace ns q <- app <| que ns qp - poll <- Scotty.param "poll" !: (pure . const False) + poll <- Scotty.param "poll" !: (pure <. const False) if poll then Scotty.stream <| streamQue q else do @@ -151,7 +151,7 @@ routes cfg = do >> Scotty.finish guardNs ns ["pub", "_"] -- passed all auth checks - app . modify <| upsertNamespace ns + app <. modify <| upsertNamespace ns q <- app <| que ns qp qdata <- Scotty.body _ <- liftIO <| Go.write q <| BSL.toStrict qdata @@ -184,7 +184,7 @@ streamQue q write _ = loop q where loop c = Go.read c - >>= (write . Builder.byteStringInsert) + >>= (write <. Builder.byteStringInsert) >> loop c -- | Gets the thing from the Hashmap. Call's 'error' if key doesn't exist. @@ -218,11 +218,11 @@ app = lift -- | Get something from the app state gets :: (AppState -> b) -> App b -gets f = ask >>= liftIO . STM.readTVarIO >>= return >= liftIO <. STM.readTVarIO >>= return AppState) -> App () -modify f = ask >>= liftIO . atomically . flip STM.modifyTVar' f +modify f = ask >>= liftIO <. atomically <. flip STM.modifyTVar' f -- | housing for a set of que paths type Namespace = Text.Lazy.Text -- cgit v1.2.3