summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-11-28 09:25:14 -0500
committerBen Sima <ben@bsima.me>2020-11-28 09:25:14 -0500
commit27e609910cbf61f792b857181b60d42ca8fdf9be (patch)
treed2a08243c4ce1806ba686681c704adc89a3caf16 /Biz
parent0a94c71a57741faa6763ff6c192dd0cccb37e11b (diff)
Ormolu formatting
Diffstat (limited to 'Biz')
-rw-r--r--Biz/Pie.hs48
1 files changed, 26 insertions, 22 deletions
diff --git a/Biz/Pie.hs b/Biz/Pie.hs
index 409f14f..8c8989d 100644
--- a/Biz/Pie.hs
+++ b/Biz/Pie.hs
@@ -103,11 +103,13 @@ formFile :: String -> FilePath
formFile ns = ns ++ ".pie"
loadForm :: Namespace -> IO Form
-loadForm ns = Directory.doesFileExist file >>= \case
- False -> touch file >> return mempty
- True -> Aeson.decodeFileStrict file >>= \case
- Nothing -> panic <| Text.pack <| "could not decode: " ++ file
- Just x -> return x
+loadForm ns =
+ Directory.doesFileExist file >>= \case
+ False -> touch file >> return mempty
+ True ->
+ Aeson.decodeFileStrict file >>= \case
+ Nothing -> panic <| Text.pack <| "could not decode: " ++ file
+ Just x -> return x
where
file = formFile ns
touch f = writeFile f ""
@@ -132,23 +134,25 @@ move mov form = case mov of
Exit.ExitFailure _ ->
Process.callProcess "git" ["switch", "-c", branch]
>> return form
- Update -> Haskeline.runInputT Haskeline.defaultSettings <| do
- timestamp <- liftIO Clock.getCurrentTime
- onTrack <- parseBool </ question "Are you on track?"
- isLaunched <- parseBool </ question "Are you launched?"
- weeksUntilLaunch <- parseInt </ question "How many weeks to launch?"
- usersTalkedWith <- parseInt </ question "Haw many (prospective) users have you talked to in the last week?"
- learnings <- parseText </ question "What have you learned from them?"
- morale <- parseInt </ question "On a scale of 1-10, what is your morale?"
- mostImprovement <- parseText </ question "What most improved your primary metric?"
- biggestObstacle <- parseText </ question "What is your biggest obstacle?"
- goals <- parseText </ question "What are your top 1-3 goals for next week?"
- return <| form {roll = BuildSprint {..} : (roll form)}
- Feedback -> Haskeline.runInputT Haskeline.defaultSettings <| do
- timestamp <- liftIO Clock.getCurrentTime
- user <- parseText </ question "User?"
- howDisappointed <- parseDisappointment </ question "How disappointed? (1=very, 2=somewhat, 3=not)"
- return <| form {roll = UserFeedback {..} : (roll form)}
+ Update ->
+ Haskeline.runInputT Haskeline.defaultSettings <| do
+ timestamp <- liftIO Clock.getCurrentTime
+ onTrack <- parseBool </ question "Are you on track?"
+ isLaunched <- parseBool </ question "Are you launched?"
+ weeksUntilLaunch <- parseInt </ question "How many weeks to launch?"
+ usersTalkedWith <- parseInt </ question "Haw many (prospective) users have you talked to in the last week?"
+ learnings <- parseText </ question "What have you learned from them?"
+ morale <- parseInt </ question "On a scale of 1-10, what is your morale?"
+ mostImprovement <- parseText </ question "What most improved your primary metric?"
+ biggestObstacle <- parseText </ question "What is your biggest obstacle?"
+ goals <- parseText </ question "What are your top 1-3 goals for next week?"
+ return <| form {roll = BuildSprint {..} : (roll form)}
+ Feedback ->
+ Haskeline.runInputT Haskeline.defaultSettings <| do
+ timestamp <- liftIO Clock.getCurrentTime
+ user <- parseText </ question "User?"
+ howDisappointed <- parseDisappointment </ question "How disappointed? (1=very, 2=somewhat, 3=not)"
+ return <| form {roll = UserFeedback {..} : (roll form)}
question :: String -> Haskeline.InputT IO String
question q = Maybe.fromJust </ (Haskeline.getInputLine <| q ++ " ")