mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-09-11 12:55:54 +03:00
ask -> asks
This commit is contained in:
parent
fa0a947ca8
commit
87d773c126
16
app/App.hs
16
app/App.hs
@ -119,14 +119,14 @@ optionFilters tms = foldl (>>=) (pure tms) matchSetFilters
|
|||||||
|
|
||||||
singleOccurrenceFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
|
singleOccurrenceFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
|
||||||
singleOccurrenceFilter tms = do
|
singleOccurrenceFilter tms = do
|
||||||
allowsSingleOccurrence <- oSingleOccurrenceMatches <$> ask
|
allowsSingleOccurrence <- asks oSingleOccurrenceMatches
|
||||||
return $ if allowsSingleOccurrence
|
return $ if allowsSingleOccurrence
|
||||||
then withOneOccurrence tms
|
then withOneOccurrence tms
|
||||||
else tms
|
else tms
|
||||||
|
|
||||||
likelihoodsFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
|
likelihoodsFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
|
||||||
likelihoodsFilter tms =
|
likelihoodsFilter tms =
|
||||||
withLikelihoods . likelihoods <$> ask <*> pure tms
|
asks $ withLikelihoods . likelihoods <*> pure tms
|
||||||
where
|
where
|
||||||
likelihoods options
|
likelihoods options
|
||||||
| oAllLikelihoods options = [High, Medium, Low]
|
| oAllLikelihoods options = [High, Medium, Low]
|
||||||
@ -134,22 +134,22 @@ likelihoodsFilter tms =
|
|||||||
| otherwise = oLikelihoods options
|
| otherwise = oLikelihoods options
|
||||||
|
|
||||||
ignoredPathsFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
|
ignoredPathsFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
|
||||||
ignoredPathsFilter tms = ignoringPaths . oIgnoredPaths <$> ask <*> pure tms
|
ignoredPathsFilter tms = asks $ ignoringPaths . oIgnoredPaths <*> pure tms
|
||||||
|
|
||||||
readFromStdIn :: AppConfig m => m Bool
|
readFromStdIn :: AppConfig m => m Bool
|
||||||
readFromStdIn = oFromStdIn <$> ask
|
readFromStdIn = asks oFromStdIn
|
||||||
|
|
||||||
groupingOptions :: AppConfig m => m CurrentGrouping
|
groupingOptions :: AppConfig m => m CurrentGrouping
|
||||||
groupingOptions = oGrouping <$> ask
|
groupingOptions = asks oGrouping
|
||||||
|
|
||||||
searchRunner :: AppConfig m => m SearchRunner
|
searchRunner :: AppConfig m => m SearchRunner
|
||||||
searchRunner = oSearchRunner <$> ask
|
searchRunner = asks oSearchRunner
|
||||||
|
|
||||||
runWithCache :: AppConfig m => m Bool
|
runWithCache :: AppConfig m => m Bool
|
||||||
runWithCache = not . oWithoutCache <$> ask
|
runWithCache = asks $ not . oWithoutCache
|
||||||
|
|
||||||
numberOfCommits :: AppConfig m => m (Maybe Int)
|
numberOfCommits :: AppConfig m => m (Maybe Int)
|
||||||
numberOfCommits = oCommitCount <$> ask
|
numberOfCommits = asks oCommitCount
|
||||||
|
|
||||||
resultFormatter :: AppConfig m => m V.ResultsFormat
|
resultFormatter :: AppConfig m => m V.ResultsFormat
|
||||||
resultFormatter = do
|
resultFormatter = do
|
||||||
|
Loading…
Reference in New Issue
Block a user