diff options
author | Ben Sima <ben@bsima.me> | 2021-01-29 02:37:14 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2021-01-29 03:22:01 -0500 |
commit | b289dee25ad8ce4c2622fadb2f4c31fb90914b39 (patch) | |
tree | 5511da780cdabbb98c8fbe01f03997d3263e7880 /Biz/Pie.hs | |
parent | 42c7614b6a4bd7504e9bf31e0882db58b85857bc (diff) |
Lint 'return' into 'pure', replace bind operator
Diffstat (limited to 'Biz/Pie.hs')
-rw-r--r-- | Biz/Pie.hs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 _ -> |