sort descending

This commit is contained in:
Jonathan Lamothe 2019-12-15 13:26:22 -05:00
parent f1227da9ca
commit 2f06fd221d

View File

@ -136,7 +136,8 @@ yearToDateStatsReport :: Int -> ProgState -> [String]
yearToDateStatsReport width s = let yearToDateStatsReport width s = let
db = s^.database db = s^.database
playerStats = sortOn (psPoints . snd) playerStats = reverse
$ sortOn (psPoints . snd)
$ map (\p -> (p, p^.pYtd)) $ map (\p -> (p, p^.pYtd))
$ filter playerIsActive $ filter playerIsActive
$ db^.dbPlayers $ db^.dbPlayers
@ -153,7 +154,8 @@ lifetimeStatsReport :: Int -> ProgState -> [String]
lifetimeStatsReport width s = let lifetimeStatsReport width s = let
db = s^.database db = s^.database
playerStats = sortOn (psPoints . snd) playerStats = reverse
$ sortOn (psPoints . snd)
$ map (\p -> (p, p^.pLifetime)) $ map (\p -> (p, p^.pLifetime))
$ db^.dbPlayers $ db^.dbPlayers