From 55c880618627a1e2c22cc4017dec2cb3c88b3c9d Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 17 Dec 2019 11:19:38 -0500 Subject: [PATCH] hlint suggestions hlint didn't like reverse, and suggested using Data.Ord Down instead --- src/Mtlstats/Report.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Mtlstats/Report.hs b/src/Mtlstats/Report.hs index 4f4684f..47fd94b 100644 --- a/src/Mtlstats/Report.hs +++ b/src/Mtlstats/Report.hs @@ -24,6 +24,7 @@ module Mtlstats.Report (report, gameDate) where import Data.List (sortOn) import qualified Data.Map as M import Data.Maybe (fromMaybe, mapMaybe) +import Data.Ord (Down (Down)) import Lens.Micro ((^.)) import Mtlstats.Config @@ -136,8 +137,7 @@ yearToDateStatsReport :: Int -> ProgState -> [String] yearToDateStatsReport width s = let db = s^.database - playerStats = reverse - $ sortOn (psPoints . snd) + playerStats = sortOn (Down . psPoints . snd) $ map (\p -> (p, p^.pYtd)) $ filter playerIsActive $ db^.dbPlayers @@ -154,8 +154,7 @@ lifetimeStatsReport :: Int -> ProgState -> [String] lifetimeStatsReport width s = let db = s^.database - playerStats = reverse - $ sortOn (psPoints . snd) + playerStats = sortOn (Down . psPoints . snd) $ map (\p -> (p, p^.pLifetime)) $ db^.dbPlayers