aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/Utils')
-rw-r--r--src/client/elm/Utils/List.elm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/elm/Utils/List.elm b/src/client/elm/Utils/List.elm
index 4886418..cc57d9f 100644
--- a/src/client/elm/Utils/List.elm
+++ b/src/client/elm/Utils/List.elm
@@ -1,5 +1,6 @@
module Utils.List exposing
( groupBy
+ , mean
)
import Dict
@@ -11,3 +12,6 @@ groupBy f xs =
in Dict.insert (f item) (item :: groupItems) dict
in List.foldr addItem Dict.empty xs
|> Dict.toList
+
+mean : List Int -> Int
+mean xs = (List.sum xs) // (List.length xs)