summaryrefslogtreecommitdiff
path: root/Biz/Que/Host.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-12-24 14:24:16 -0500
committerBen Sima <ben@bsima.me>2020-12-24 14:24:16 -0500
commit6eaaf3d8ce6025932990de6fa697d14c9651be76 (patch)
tree65ca4a0dd0393db98d9a6067bbbef789469e8122 /Biz/Que/Host.hs
parent6a4a8aa37044d578c95dea145b9605908b8dc28d (diff)
linting fixes and cleanup
Diffstat (limited to 'Biz/Que/Host.hs')
-rw-r--r--Biz/Que/Host.hs14
1 files changed, 7 insertions, 7 deletions
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 </ f
+gets f = ask >>= liftIO <. STM.readTVarIO >>= return </ f
-- | Apply a function to the app state
modify :: (AppState -> 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