mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-08-15 15:50:26 +03:00
Remove unnecessary parens
This commit is contained in:
parent
50399ec4b1
commit
558c4ed2f4
@ -9,13 +9,13 @@ search t = do
|
||||
results <- ag t
|
||||
return $ linesMap prefixTerm results
|
||||
where
|
||||
prefixTerm = ((++) t)
|
||||
prefixTerm = (++ t)
|
||||
|
||||
linesMap :: (String -> String) -> String -> [String]
|
||||
linesMap f =
|
||||
filter empty . map f . lines
|
||||
where
|
||||
empty = ((/=) 0) . length
|
||||
empty = (/= 0) . length
|
||||
|
||||
ag :: String -> IO String
|
||||
ag t = do
|
||||
|
@ -107,10 +107,10 @@ responseForPath s =
|
||||
filterVByPath . filterKVByPath
|
||||
where
|
||||
filterVByPath = Map.map (updateMatchesWith newMatches)
|
||||
filterKVByPath = Map.filterWithKey (\_ a -> s `elem` allPaths a)
|
||||
filterKVByPath = Map.filterWithKey (const $ \a -> s `elem` allPaths a)
|
||||
allPaths = fmap (fileNameGrouping . tmPath) . trMatches
|
||||
updateMatchesWith f tr = tr { trMatches = f tr }
|
||||
newMatches = (filter (((==) s) . fileNameGrouping . tmPath) . trMatches)
|
||||
newMatches = (filter ((== s) . fileNameGrouping . tmPath) . trMatches)
|
||||
|
||||
fileNameGrouping :: String -> DirectoryPrefix
|
||||
fileNameGrouping =
|
||||
|
@ -8,5 +8,5 @@ groupBy :: Eq b => (a -> b) -> [a] -> [(b, [a])]
|
||||
groupBy f l =
|
||||
fmap (\t -> (t, byTerm t)) uniqueTerms
|
||||
where
|
||||
byTerm t = filter (((==) t) . f) l
|
||||
byTerm t = filter ((== t) . f) l
|
||||
uniqueTerms = nub $ fmap f l
|
||||
|
Loading…
Reference in New Issue
Block a user