Skip to content

Commit

Permalink
Follow hlint suggestion: avoid reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed May 26, 2024
1 parent 9782bea commit 72bb10b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- ignore: {name: "Use infix"} # 3 hints

# Warnings currently triggered by your code
- ignore: {name: "Avoid reverse"} # 1 hint
- ignore: {name: "Functor law"} # 2 hints
- ignore: {name: "Fuse concatMap/<$>"} # 1 hint
- ignore: {name: "Fuse foldr/<$>"} # 2 hints
Expand Down
3 changes: 2 additions & 1 deletion src/Language/Fixpoint/Horn/Info.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Language.Fixpoint.Horn.Info (
) where

import Control.Monad (forM)
import Data.Ord (Down(..), comparing)
import qualified Data.HashMap.Strict as M
import qualified Data.List as L
import qualified Data.Tuple as Tuple
Expand Down Expand Up @@ -225,7 +226,7 @@ qualParams env e = do
ixts <- forM xs $ \x -> do
(t, i) <- lookupBindEnv x env
return (i, x, t)
return [ (x, t) | (_, x, t) <- reverse . L.sort $ ixts ]
return [ (x, t) | (_, x, t) <- L.sortBy (comparing Down) $ ixts ]

Check warning on line 229 in src/Language/Fixpoint/Horn/Info.hs

View workflow job for this annotation

GitHub Actions / hlint-3.8

Suggestion in qualParams in module Language.Fixpoint.Horn.Info: Redundant $ ▫︎ Found: "L.sortBy (comparing Down) $ ixts" ▫︎ Perhaps: "L.sortBy (comparing Down) ixts"

-- ixts = [ (i, x, t) | x <- xs, (i, t) <- lookupBindEnv x env ]

Expand Down

0 comments on commit 72bb10b

Please sign in to comment.