diff options
author | Andrew Cady <d@jerkface.net> | 2022-11-21 11:20:07 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2022-11-21 11:20:07 -0500 |
commit | ce5f3f7ff59f7d9d674ad54bde3ed4f315c8b93f (patch) | |
tree | a08b26d7bfbae13550ecd97f5b5e2cdc318a0a2e | |
parent | 2262dd62bc007c2ee9485ed9af248eba305fe051 (diff) |
cleanups
-rwxr-xr-x | repgoal.hs | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -175,14 +175,14 @@ lookup' :: Int -> NESeq a -> a | |||
175 | lookup' i seq = fromJust $ NESeq.lookup (i `mod` NESeq.length seq) seq | 175 | lookup' i seq = fromJust $ NESeq.lookup (i `mod` NESeq.length seq) seq |
176 | 176 | ||
177 | liftRows :: WeekSelection -> (Lift, Maybe LiftRecord) -> [[Widget n]] | 177 | liftRows :: WeekSelection -> (Lift, Maybe LiftRecord) -> [[Widget n]] |
178 | -- liftRows week lift = filter (not . null) $ (flip map) (annotatePosition $ liftScheme Fresher week) $ liftRow lift | 178 | liftRows week (Lift _name Wendler, Just liftRecord) = |
179 | liftRows week (Lift _name Wendler, Just liftRecord) = (flip map) (annotatePosition $ liftScheme Fresher week) $ wendlerLiftRow liftRecord | 179 | (flip map) (annotatePosition $ liftScheme Fresher week) $ wendlerLiftRow liftRecord |
180 | liftRows _ (Lift name (Accessory sets reps), _) = (flip map) (annotatePosition $ take sets $ repeat reps) $ accessoryLiftRow name reps | 180 | liftRows _ (Lift name (Accessory sets reps), _) = |
181 | liftRows _ (Lift name Unspecified, _) = [unspecifiedLiftRow name] | 181 | (flip map) (annotatePosition $ take sets $ repeat reps) $ accessoryLiftRow name reps |
182 | 182 | liftRows _ (Lift name Unspecified, _) = | |
183 | -- liftRow :: (Lift, Maybe LiftRecord) -> (ListPosition, SetScheme) -> [Widget n] | 183 | [unspecifiedLiftRow name] |
184 | -- liftRow (_, Nothing) _ = [] | 184 | |
185 | -- liftRow (Lift _name Wendler, Just x) y = wendlerLiftRow x y | 185 | accessoryLiftRow :: Text -> Int -> (ListPosition, Int) -> [Widget n] |
186 | accessoryLiftRow name targetReps (position, _) = map (padLeftRight 2) [ | 186 | accessoryLiftRow name targetReps (position, _) = map (padLeftRight 2) [ |
187 | txt $ case position of FirstInList -> name; NotFirstInList -> " ", | 187 | txt $ case position of FirstInList -> name; NotFirstInList -> " ", |
188 | str $ printf "%2d @ %5s" targetReps (" " :: String), | 188 | str $ printf "%2d @ %5s" targetReps (" " :: String), |
@@ -191,6 +191,7 @@ accessoryLiftRow name targetReps (position, _) = map (padLeftRight 2) [ | |||
191 | txt " ", | 191 | txt " ", |
192 | txt " " | 192 | txt " " |
193 | ] | 193 | ] |
194 | unspecifiedLiftRow :: Text -> [Widget n] | ||
194 | unspecifiedLiftRow name = map (padLeftRight 2) [ | 195 | unspecifiedLiftRow name = map (padLeftRight 2) [ |
195 | txt name, | 196 | txt name, |
196 | txt " ", | 197 | txt " ", |
@@ -200,6 +201,7 @@ unspecifiedLiftRow name = map (padLeftRight 2) [ | |||
200 | txt " " | 201 | txt " " |
201 | ] | 202 | ] |
202 | 203 | ||
204 | wendlerLiftRow :: LiftRecord -> (ListPosition, SetScheme) -> [Widget n] | ||
203 | wendlerLiftRow LiftRecord{..} (position, (SetScheme targetRatio targetReps amrap)) = | 205 | wendlerLiftRow LiftRecord{..} (position, (SetScheme targetRatio targetReps amrap)) = |
204 | let best = bestPerformance stats | 206 | let best = bestPerformance stats |
205 | computedTarget = targetRatio * (90 % 100) * computeOneRepMax best | 207 | computedTarget = targetRatio * (90 % 100) * computeOneRepMax best |