Remove unnecessary parens

This commit is contained in:
Joshua Clayton 2016-05-04 21:26:01 -04:00
parent 50399ec4b1
commit 558c4ed2f4
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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 =

View File

@ -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