From b289dee25ad8ce4c2622fadb2f4c31fb90914b39 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 29 Jan 2021 02:37:14 -0500 Subject: Lint 'return' into 'pure', replace bind operator --- Hero/Host.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Hero/Host.hs') diff --git a/Hero/Host.hs b/Hero/Host.hs index fd010af..5496f27 100644 --- a/Hero/Host.hs +++ b/Hero/Host.hs @@ -106,7 +106,7 @@ move _ = bracket startup shutdown run run (cfg, app, _) = Warp.run (heroPort cfg) app prn = IO.hPutStrLn IO.stderr startup = - Envy.decodeEnv >>= \case + Envy.decodeEnv +> \case Left e -> Exit.die e Right cfg -> do @@ -139,7 +139,7 @@ move _ = bracket startup shutdown run :<|> wrapAuth appHostHandlers -- fall through to 404 :<|> Tagged handle404 - return + pure ( cfg, serveWithContext proxy @@ -150,11 +150,11 @@ move _ = bracket startup shutdown run shutdown :: App -> IO () shutdown (_, _, keep) = do Keep.close keep - return () + pure () upsertKey :: FilePath -> IO Crypto.JWK upsertKey fp = - Directory.doesFileExist fp >>= \exists -> + Directory.doesFileExist fp +> \exists -> if exists then Auth.readKey fp else Auth.writeKey fp >> Auth.readKey fp @@ -229,7 +229,7 @@ type CssRoute = "css" :> "main.css" :> Get '[CSS] Text cssHandlers :: Server CssRoute cssHandlers = - return <. Lazy.toStrict <. Clay.render <| Typography.main <> Look.main + pure <. Lazy.toStrict <. Clay.render <| Typography.main <> Look.main type AuthRoute = "auth" @@ -274,7 +274,7 @@ authHandler cookieSettings jwtSettings loginForm = mApplyCookies <- liftIO <| Auth.acceptLogin cookieSettings jwtSettings usr case mApplyCookies of Nothing -> throwError err401 - Just applyCookies -> return <| applyCookies usr + Just applyCookies -> pure <| applyCookies usr -- | See also 'server' above type AllRoutes auths = -- cgit v1.2.3