summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2022-09-15 12:01:43 -0400
committerAndrew Cady <d@cryptonomic.net>2022-09-15 12:01:43 -0400
commit5e1eb34db0e5656544ea717e49a663680201b5b9 (patch)
tree4b238d4dd90d3de81940efff0c09ca6902e6e3e9
parentfec49d4b82bd034b0b57daf701625f55f83dff67 (diff)
fix warnings
-rwxr-xr-xcountdown.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/countdown.hs b/countdown.hs
index 9f29d1f..7d9299c 100755
--- a/countdown.hs
+++ b/countdown.hs
@@ -62,6 +62,7 @@ billion = 1000 * 1000 * 1000
62ageOfUniverseInYears :: Integer 62ageOfUniverseInYears :: Integer
63ageOfUniverseInYears = 13787 * 1000 * 1000 63ageOfUniverseInYears = 13787 * 1000 * 1000
64 64
65daysPerYear :: NominalDiffTime
65daysPerYear = 365.2422 66daysPerYear = 365.2422
66 67
67lengthOfYear :: NominalDiffTime 68lengthOfYear :: NominalDiffTime
@@ -138,15 +139,15 @@ countdownWidget isSimulated t =
138 daysLeft 139 daysLeft
139 (pluralize daysLeft) 140 (pluralize daysLeft)
140 (pluralizeVerb daysLeft) 141 (pluralizeVerb daysLeft)
141 (commasF2 hoursLeft) 142 (commasF 2 hoursLeft)
142 (pluralize $ floor hoursLeft) 143 (pluralize $ (floor hoursLeft :: Integer))
143 (pluralizeVerb $ floor hoursLeft) 144 (pluralizeVerb $ (floor hoursLeft :: Integer))
144 (commas secondsLeft) 145 (commas secondsLeft)
145 (pluralize secondsLeft) 146 (pluralize secondsLeft)
146 (pluralizeVerb secondsLeft))) 147 (pluralizeVerb secondsLeft)))
147 <+> 148 <+>
148 (borderWithLabel (str "Cosmic Countdown") $ 149 (borderWithLabel (str "Cosmic Countdown") $
149 (str $ printf "%s years ago" (commas $ floor cosmicYearsAgo)) 150 (str $ printf "%s years ago" (commas $ (floor cosmicYearsAgo :: Integer)))
150 <=> 151 <=>
151 (str "\n\n") 152 (str "\n\n")
152 <=> 153 <=>
@@ -156,7 +157,7 @@ countdownWidget isSimulated t =
156 <=> 157 <=>
157 (str $ printf "%s thousand years ago" (commasF 3 $ cosmicYearsAgo / 1000)) 158 (str $ printf "%s thousand years ago" (commasF 3 $ cosmicYearsAgo / 1000))
158 <=> 159 <=>
159 (str $ printf "%s days ago" (commas $ floor $ realToFrac cosmicYearsAgo * daysPerYear))) 160 (str $ printf "%s days ago" (commas $ (floor $ realToFrac cosmicYearsAgo * daysPerYear :: Integer))))
160 <=> 161 <=>
161 (borderWithLabel (str progressLabel) $ 162 (borderWithLabel (str progressLabel) $
162 updateAttrMap 163 updateAttrMap
@@ -188,8 +189,6 @@ countdownWidget isSimulated t =
188 x // y = fromRational $ toRational x / toRational y :: Double 189 x // y = fromRational $ toRational x / toRational y :: Double
189 progressLabel = printf "%.6F%%" (100 * (yearElapsed // yearLength)) 190 progressLabel = printf "%.6F%%" (100 * (yearElapsed // yearLength))
190 191
191commasF2 = commasF 2
192
193commasF :: RealFrac x => Int -> x -> Text 192commasF :: RealFrac x => Int -> x -> Text
194commasF precision = prettyF cfg 193commasF precision = prettyF cfg
195 where 194 where