We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4218a15 commit 533f561Copy full SHA for 533f561
1 file changed
app/Main.hs
@@ -38,17 +38,13 @@ main = do
38
covid
39
putStrLn $ replicate 100 '-'
40
41
-
42
-mean :: (Fractional a, VG.Vector v a) => v a -> a
43
-mean xs = VG.sum xs / fromIntegral (VG.length xs)
44
45
oneBillingRowChallenge :: IO ()
46
oneBillingRowChallenge = do
47
parsed <- D.readSeparated ';' D.defaultOptions "./data/measurements.txt"
48
print $
49
parsed
50
|> D.groupBy ["City"]
51
- |> D.reduceBy (\v -> (VG.minimum v, mean @Double v, VG.maximum v)) "Measurement"
+ |> D.aggregate (zip (repeat "Measurement") [D.Minimum, D.Mean, D.Maximum])
52
|> D.sortBy D.Ascending ["City"]
53
54
housing :: IO ()
0 commit comments