commercialhaskell / path

Typed filepath
Other
120 stars 45 forks source link

Add `takeDrive :: Path Abs t -> Path Abs Dir` #190

Closed mpilgrem closed 8 months ago

mpilgrem commented 9 months ago

The filepath package provides System.FilePath.takeDrive :: FilePath -> FilePath. It would be useful to have a well-typed version.

EDIT: The motivation is to avoid the round-tripping in this code from the Stack project:

destDrive = fromJust $ parseAbsDir $ takeDrive $ fromAbsDir destDir
NorfairKing commented 9 months ago

I see no issue with this. PR welcome.

mpilgrem commented 9 months ago

A pull request, including additions to the tests, is a work-in-progress.