- Dr. Alistair Ward
- type SearchPath = [FilePath]
- type LocatedData a = (FilePath, a)
- locate :: FilePath -> SearchPath -> IO [FilePath]
- getFile :: FilePath -> SearchPath -> IO (LocatedData String)
- fromFile :: Read a => FilePath -> SearchPath -> IO (LocatedData a)
- getFilePath :: LocatedData a -> FilePath
- getData :: LocatedData a -> a
- When supplied with an absolute file-path, the search-path is ignored and an exception is thrown if either the file-path is invalid or the file doesn't exist.
- If the specified file-name is relative, all matching instances on the specified search-path are returned.
- CAVEAT: doesn't perform file-globbing.
Traverse the search-path, looking for matching instances of the specified file-name, and either throw an exception, or return a pair composed from the path to the first matching file, together with its contents.
- Returns the polymorphic data, read from the first matching file on the search-path, along with the path from which it was read.
- Returns an error on failure to parse the contents of the first matching file found on the search-path.