From ccaec90a45492a579159e92926bde2b1e3a91311 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 4 Oct 2022 08:11:56 -0400 Subject: trivial refactor/cleanup/formatting/comment --- repgoal.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/repgoal.hs b/repgoal.hs index 480d1e2..28e48a1 100755 --- a/repgoal.hs +++ b/repgoal.hs @@ -104,23 +104,26 @@ drawUI () = [a] where a = vCenter $ hCenter $ renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Achieved Best", "Computed 1RM", "Goal Reps", "Goal+1"] : map toRow lifts - toRow x@LiftTarget{..} = + toRow target@LiftTarget{..} = let best@Achieved{..} = bestPerformance stats - repGoal = computeRepGoal x - goalTo1RM g = computeOneRepMax $ Achieved g targetWeight + repGoal = computeRepGoal target + goalTo1RM g = computeOneRepMax $ Achieved g targetWeight + showGoal g = printf "%d @ %s ≈ 1 @ %s" g (showRational targetWeight) (showRational (goalTo1RM g)) in map (padLeftRight 2) [ txt $ liftName, str $ printf "%d @ %s" achievedReps (showRational achievedWeight), str $ showRational $ computeOneRepMax best, - str $ printf "%d @ %s ≈ 1 @ %s" (repGoal) (showRational targetWeight) (showRational (goalTo1RM repGoal)), - str $ printf "%d @ %s ≈ 1 @ %s" (repGoal + 1) (showRational targetWeight) (showRational (goalTo1RM $ repGoal + 1)) + str $ showGoal repGoal, + str $ showGoal (repGoal + 1) ] - where +-- TODO: State contains chosen repmax formula +-- TODO: State contains performances type St = () +-- TODO: Event for inotify on edited text file (as input interface) type CustomEvent = () handleEvent :: St -> BrickEvent () CustomEvent -> EventM () (Next St) -- cgit v1.2.3