File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -247,11 +247,10 @@ filter p = runIdentity . filterM (return . p)
247247find :: (FilePath -> Bool ) -> FSForest -> FSForest
248248find p = snd . extract p
249249
250- -- | A generalization of 'find'. The first element of the result
251- -- represents the forest after removing all subtrees that match the given predicate,
252- -- and the second element is a list of trees that matched. This could be useful if
253- -- you want to handle certain directories specially from others within a
254- -- sub-filesystem.
250+ -- | The first element of the result represents the forest after removing all
251+ -- subtrees that match the given predicate, and the second element is a list of
252+ -- trees that matched. This could be useful if you want to handle certain
253+ -- directories specially from others within a sub-filesystem.
255254extract :: (FilePath -> Bool ) -> FSForest -> (FSForest , FSForest )
256255extract p = runIdentity . extractM (return . p)
257256
Original file line number Diff line number Diff line change 1+ import System.File.Tree as FS
2+ import Control.Applicative
3+ import System.Directory
4+ import Data.List
5+
6+ main = do
7+ d <- getDirectory =<< getHomeDirectory
8+ print . FS. filter (" .mozilla/" `isInfixOf` ) . (: [] ) $ d
9+
You can’t perform that action at this time.
0 commit comments