From e9a53b69ad68e531a789eff3128f7304fd411808 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 15 Apr 2020 15:24:32 -0700 Subject: Lint fixes, also delete Biz.Language --- Que/Server.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Que/Server.hs') diff --git a/Que/Server.hs b/Que/Server.hs index b0f3fbd..9e8d893 100644 --- a/Que/Server.hs +++ b/Que/Server.hs @@ -84,7 +84,7 @@ newtype App a (STM.TVar AppState) ) -data AppState +newtype AppState = AppState { ques :: HashMap Namespace Quebase } @@ -92,7 +92,7 @@ data AppState initialAppState :: AppState initialAppState = AppState {ques = mempty} -data Config +newtype Config = Config { -- | QUE_PORT quePort :: Warp.Port @@ -139,9 +139,9 @@ routes = do q <- app <| que ns qp poll <- Scotty.param "poll" !: (pure . const False) guardNs ns ["pub", "_"] - case poll of - True -> Scotty.stream $ streamQue q - _ -> do + if poll + then Scotty.stream $ streamQue q + else do r <- liftIO <| Go.read q Scotty.html <| fromStrict <| Encoding.decodeUtf8 r -- POST que @@ -225,7 +225,7 @@ 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 AppState) -> App () -- cgit v1.2.3