a version of getDataFileName that uses OsPath
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the feature request**
Cabal has the feature to generate a Paths_ module that exports utility functions to access data files; for example, it generates a 'getDataFileName :: FilePath -> IO FilePath' function that given a fileName/local filePath constructs the correct absolute path to the file in the data-directory set in the cabal file. See https://cabal.readthedocs.io/en/stable/cabal-package-description-file.html#accessing-data-files-from-package-code for details.
It would be nice if cabal could generate a similar functions that use OsPath rather than FilePath; since OsPath provides a better/more compact encoding of file paths. Perhaps it would be cleanest if cabal would actually generate a separate module (e.g. OsPaths_) that has the OsPath versions.
Contributor guide
Research direction
Start with Cabal's generated Paths_ module and the existing getDataFileName function described in the linked data-files documentation. Investigate how the generated module is specified and whether a separate OsPaths_ module is appropriate. Done means Cabal generates usable OsPath-based data-file accessors for packages that request the feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100