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 --- Biz/Pie.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Biz/Pie.hs') diff --git a/Biz/Pie.hs b/Biz/Pie.hs index 5c5ef56..446e756 100644 --- a/Biz/Pie.hs +++ b/Biz/Pie.hs @@ -95,12 +95,12 @@ formFile ns = ns ++ ".pie" loadForm :: String -> IO Form loadForm ns = - Directory.doesFileExist file >>= \case - False -> return mempty + Directory.doesFileExist file +> \case + False -> pure mempty True -> - Aeson.decodeFileStrict file >>= \case + Aeson.decodeFileStrict file +> \case Nothing -> panic <| Text.pack <| "could not decode: " ++ file - Just x -> return x + Just x -> pure x where file = formFile ns @@ -126,10 +126,10 @@ fromArgs args move :: Cli.Arguments -> IO () move args = case fromArgs args of New -> do - week <- Time.getCurrentTime >>= return <. Time.formatTime Time.defaultTimeLocale "%V" + week <- Time.getCurrentTime +> pure <. Time.formatTime Time.defaultTimeLocale "%V" let branch = "sprint-" <> week proc <- Process.spawnProcess "git" ["show-ref", branch] - Process.waitForProcess proc >>= \case + Process.waitForProcess proc +> \case Exit.ExitSuccess -> Process.callProcess "git" ["switch", branch] Exit.ExitFailure _ -> -- cgit v1.2.3