summaryrefslogtreecommitdiff
path: root/Hero/Host.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-01-29 02:37:14 -0500
committerBen Sima <ben@bsima.me>2021-01-29 03:22:01 -0500
commitb289dee25ad8ce4c2622fadb2f4c31fb90914b39 (patch)
tree5511da780cdabbb98c8fbe01f03997d3263e7880 /Hero/Host.hs
parent42c7614b6a4bd7504e9bf31e0882db58b85857bc (diff)
Lint 'return' into 'pure', replace bind operator
Diffstat (limited to 'Hero/Host.hs')
-rw-r--r--Hero/Host.hs12
1 files changed, 6 insertions, 6 deletions
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 =