Point-free filter lambdas

This commit is contained in:
Joshua Clayton 2016-05-03 05:17:20 -04:00
parent f5394e4b36
commit e64db21f9e

View File

@ -40,10 +40,10 @@ resultsFromMatches m =
totalOccurrences' = sum $ fmap occurrences m
withOneFile :: ParseResponse -> ParseResponse
withOneFile = fmap $ Map.filterWithKey (\_ a -> totalFiles a == 1)
withOneFile = fmap $ Map.filterWithKey (const $ ((==) 1) . totalFiles)
withOneOccurrence :: ParseResponse -> ParseResponse
withOneOccurrence = fmap $ Map.filterWithKey (\_ a -> totalOccurrences a == 1)
withOneOccurrence = fmap $ Map.filterWithKey (const $ ((==) 1 ) . totalOccurrences)
listFromMatchSet :: TermMatchSet -> [(String, [TermMatch])]
listFromMatchSet =