Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Finding files.
Synopsis
- findFileUp :: (MonadIO m, MonadThrow m) => Path Abs Dir -> (Path Abs File -> Bool) -> Maybe (Path Abs Dir) -> m (Maybe (Path Abs File))
- findDirUp :: (MonadIO m, MonadThrow m) => Path Abs Dir -> (Path Abs Dir -> Bool) -> Maybe (Path Abs Dir) -> m (Maybe (Path Abs Dir))
- findFiles :: Path Abs Dir -> (Path Abs File -> Bool) -> (Path Abs Dir -> Bool) -> IO [Path Abs File]
- findInParents :: MonadIO m => (Path Abs Dir -> m (Maybe a)) -> Path Abs Dir -> m (Maybe a)
Documentation
:: (MonadIO m, MonadThrow m) | |
=> Path Abs Dir | Start here. |
-> (Path Abs File -> Bool) | Predicate to match the file. |
-> Maybe (Path Abs Dir) | Do not ascend above this directory. |
-> m (Maybe (Path Abs File)) | Absolute file path. |
Find the location of a file matching the given predicate.
:: (MonadIO m, MonadThrow m) | |
=> Path Abs Dir | Start here. |
-> (Path Abs Dir -> Bool) | Predicate to match the directory. |
-> Maybe (Path Abs Dir) | Do not ascend above this directory. |
-> m (Maybe (Path Abs Dir)) | Absolute directory path. |
Find the location of a directory matching the given predicate.
:: Path Abs Dir | Root directory to begin with. |
-> (Path Abs File -> Bool) | Predicate to match files. |
-> (Path Abs Dir -> Bool) | Predicate for which directories to traverse. |
-> IO [Path Abs File] | List of matching files. |
Find files matching predicate below a root directory.
NOTE: this skips symbolic directory links, to avoid loops. This may not make sense for all uses of file finding.
TODO: write one of these that traverses symbolic links but efficiently ignores loops.