diff options
Diffstat (limited to 'Biz/Que')
-rw-r--r-- | Biz/Que/Host.hs | 8 | ||||
-rw-r--r-- | Biz/Que/Site.hs | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/Biz/Que/Host.hs b/Biz/Que/Host.hs index cbf4bfd..e40b2e0 100644 --- a/Biz/Que/Host.hs +++ b/Biz/Que/Host.hs @@ -63,7 +63,7 @@ move :: Cli.Arguments -> IO () move _ = Exception.bracket startup shutdown <| uncurry Warp.run where startup = - Envy.decodeWithDefaults Envy.defConfig >>= \c -> do + Envy.decodeWithDefaults Envy.defConfig +> \c -> do sync <- STM.newTVarIO initialAppState let runActionToIO m = runReaderT (runApp m) sync waiapp <- Scotty.scottyAppT runActionToIO <| routes c @@ -207,7 +207,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. @@ -241,11 +241,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 diff --git a/Biz/Que/Site.hs b/Biz/Que/Site.hs index 3e456da..0d89400 100644 --- a/Biz/Que/Site.hs +++ b/Biz/Que/Site.hs @@ -83,7 +83,7 @@ getKey ns = do auth ns |> Config.parseIniFile conf |> either errorParsingConf identity - |> return + |> pure errorParsingConf :: error errorParsingConf = panic "could not parse ~/.config/que.conf" @@ -111,11 +111,11 @@ run key ns Sources {..} = Async.runConcurrently actions |> void actions = traverse Async.Concurrently - [ toHtml index >>= serve key ns "index" |> forever, - toHtml quescripts >>= serve key ns "quescripts" |> forever, - BS.readFile client >>= serve key ns "client" |> forever, - toHtml tutorial >>= serve key ns "tutorial" |> forever, - toHtml apidocs >>= serve key ns "apidocs" |> forever + [ toHtml index +> serve key ns "index" |> forever, + toHtml quescripts +> serve key ns "quescripts" |> forever, + BS.readFile client +> serve key ns "client" |> forever, + toHtml tutorial +> serve key ns "tutorial" |> forever, + toHtml apidocs +> serve key ns "apidocs" |> forever ] toHtml :: FilePath -> IO ByteString toHtml md = @@ -143,7 +143,7 @@ serve Nothing "pub" path content = (ReqBodyBs content) ignoreResponse mempty - liftIO <| return () + liftIO <| pure () serve Nothing p _ _ = panic <| "no auth key provided for ns: " <> p serve (Just key) ns path content = runReq defaultHttpConfig <| do @@ -156,4 +156,4 @@ serve (Just key) ns path content = (ReqBodyBs content) ignoreResponse options - liftIO <| return () + liftIO <| pure () |