commercialhaskell / path

Typed filepath
Other
122 stars 45 forks source link

how to remove an extension? add removeExtension function #155

Closed andrewufrank closed 2 months ago

andrewufrank commented 4 years ago

I need to construct a filename without extension from a file with an extension. In the past I have used setFileExtension which is depreciated.

Using setExtension with an extension "" does not work (check on valid extension fails). Neither does replaceExtension.

I would suggest to add a removeExtension function.

Thank you for a very well crafted package!

NorfairKing commented 4 years ago

+1 from me! I think this problem got introduced when setExtension was changed. @andrewufrank Do you want to make a PR?

andrewufrank commented 4 years ago

I had the same impression - it appeared when I got back to work on code after a long absence. I have no problem, if you do the PR, having more experience with such things. Thank you!

NorfairKing commented 2 months ago

PR still welcome