avoid duplicate code with a more generic monadic matcher

Interesting type signature ghc derived for this:
forall o (m :: * -> *). Monad m => Matcher o -> (o -> m Bool) -> m Bool
This commit is contained in:
Joey Hess 2012-10-13 15:17:15 -04:00
parent 902ef88266
commit c78975babb
2 changed files with 12 additions and 13 deletions

View file

@ -53,8 +53,8 @@ isPreferredContent mu notpresent file = do
case M.lookup u m of
Nothing -> return True
Just matcher ->
Utility.Matcher.matchM2 matcher notpresent $
getTopFilePath file
Utility.Matcher.matchMrun matcher $ \a ->
a notpresent (getTopFilePath file)
{- Read the preferredContentLog into a map. The map is cached for speed. -}
preferredContentMap :: Annex Annex.PreferredContentMap