path-extensions (empty) → 0.0.1.0
raw patch · 6 files changed
+172/−0 lines, 6 filesdep +basedep +exceptionsdep +pathsetup-changed
Dependencies added: base, exceptions, path
Files
- ChangeLog.md +3/−0
- LICENSE +30/−0
- README.md +1/−0
- Setup.hs +2/−0
- path-extensions.cabal +35/−0
- src/Path/Extensions.hs +101/−0
+ ChangeLog.md view
@@ -0,0 +1,3 @@+# Changelog for path-extensions++## Unreleased changes
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Author name here (c) 2020++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Author name here nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,1 @@+# path-extensions
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ path-extensions.cabal view
@@ -0,0 +1,35 @@+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.33.0.+--+-- see: https://github.com/sol/hpack+--+-- hash: 165b84035809027d86704f5d9ea0c7783ecd43282e6ca4496010267b23ff5af8++name: path-extensions+version: 0.0.1.0+synopsis: Enumeration of common filetype extensions for use with the path library.+description: Enumeration of common filetype extensions for use with the path library, add variants for adding an extension to a path and with variants for replacing an existing extension.+category: Filesystem+author: Daniel Firth+maintainer: dan.firth@homotopic.tech+copyright: 2020 Daniel Firth+license: BSD3+license-file: LICENSE+build-type: Simple+extra-source-files:+ README.md+ ChangeLog.md++library+ exposed-modules:+ Path.Extensions+ other-modules:+ Paths_path_extensions+ hs-source-dirs:+ src+ build-depends:+ base >=4.7 && <5+ , exceptions+ , path+ default-language: Haskell2010
+ src/Path/Extensions.hs view
@@ -0,0 +1,101 @@+module Path.Extensions where++import Control.Monad.Catch+import Path++c_extension = ".c"+cpp_extension = ".cpp"+css_extension = ".css"+gif_extension = ".gif"+hs_extension = ".hs"+html_extension = ".html"+jpg_extension = ".jpg"+js_extension = ".js"+md_extension = ".md"+mp4_extension = ".mp4"+o_extension = ".o"+pdf_extension = ".pdf"+php_extension = ".php"+png_extension = ".png"+xml_extension = ".xml"++addCExtension :: MonadThrow m => Path b File -> m (Path b File)+addCExtension = addExtension c_extension++addCppExtension :: MonadThrow m => Path b File -> m (Path b File)+addCppExtension = addExtension cpp_extension++addCssExtension :: MonadThrow m => Path b File -> m (Path b File)+addCssExtension = addExtension css_extension++addGifExtension :: MonadThrow m => Path b File -> m (Path b File)+addGifExtension = addExtension c_extension++addHsExtension :: MonadThrow m => Path b File -> m (Path b File)+addHsExtension = addExtension gif_extension++addHtmlExtension :: MonadThrow m => Path b File -> m (Path b File)+addHtmlExtension = addExtension html_extension++addJpgExtension :: MonadThrow m => Path b File -> m (Path b File)+addJpgExtension = addExtension jpg_extension++addMdExtension :: MonadThrow m => Path b File -> m (Path b File)+addMdExtension = addExtension md_extension++addMp4Extension :: MonadThrow m => Path b File -> m (Path b File)+addMp4Extension = addExtension mp4_extension++addOExtension :: MonadThrow m => Path b File -> m (Path b File)+addOExtension = addExtension o_extension++addPdfExtension :: MonadThrow m => Path b File -> m (Path b File)+addPdfExtension = addExtension pdf_extension++addPhpExtension :: MonadThrow m => Path b File -> m (Path b File)+addPhpExtension = addExtension php_extension++addPngExtension :: MonadThrow m => Path b File -> m (Path b File)+addPngExtension = addExtension png_extension++addXmlExtension :: MonadThrow m => Path b File -> m (Path b File)+addXmlExtension = addExtension xml_extension++withCExtension :: MonadThrow m => Path b File -> m (Path b File)+withCExtension = replaceExtension c_extension++withCppExtension :: MonadThrow m => Path b File -> m (Path b File)+withCppExtension = replaceExtension cpp_extension++withCssExtension :: MonadThrow m => Path b File -> m (Path b File)+withCssExtension = replaceExtension css_extension++withGifExtension :: MonadThrow m => Path b File -> m (Path b File)+withGifExtension = replaceExtension gif_extension++withHsExtension :: MonadThrow m => Path b File -> m (Path b File)+withHsExtension = replaceExtension hs_extension++withHtmlExtension :: MonadThrow m => Path b File -> m (Path b File)+withHtmlExtension = replaceExtension html_extension++withJpgExtension :: MonadThrow m => Path b File -> m (Path b File)+withJpgExtension = replaceExtension jpg_extension++withMdExtension :: MonadThrow m => Path b File -> m (Path b File)+withMdExtension = replaceExtension md_extension++withMp4Extension :: MonadThrow m => Path b File -> m (Path b File)+withMp4Extension = replaceExtension mp4_extension++withPdfExtension :: MonadThrow m => Path b File -> m (Path b File)+withPdfExtension = replaceExtension pdf_extension++withPhpExtension :: MonadThrow m => Path b File -> m (Path b File)+withPhpExtension = replaceExtension php_extension++withPngExtension :: MonadThrow m => Path b File -> m (Path b File)+withPngExtension = replaceExtension png_extension++withXmlExtension :: MonadThrow m => Path b File -> m (Path b File)+withXmlExtension = replaceExtension xml_extension