packages feed

path-io 1.7.0 → 1.8.0

raw patch · 3 files changed

+55/−6 lines, 3 filesdep ~basedep ~path

Dependency ranges changed: base, path

Files

CHANGELOG.md view
@@ -1,3 +1,10 @@+*Path IO follows [SemVer](https://semver.org/).*++## Path IO 1.8.0++* Added instances of `AnyPath` for `SomeBase`. [PR+  72](https://github.com/mrkkrp/path-io/pull/72).+ ## Path IO 1.7.0  * Added `doesPathExist`, `getFileSize`, `renamePath`, and
Path/IO.hs view
@@ -1102,6 +1102,48 @@   makeRelative b p = parseRelDir (F.makeRelative (toFilePath b) (toFilePath p))   makeRelativeToCurrentDir p = liftIO $ getCurrentDir >>= flip makeRelative p +-- | @since 1.8.0+instance AnyPath (SomeBase File) where+  type AbsPath (SomeBase File) = Path Abs File+  type RelPath (SomeBase File) = Path Rel File++  canonicalizePath s = case s of+    Abs a -> canonicalizePath a+    Rel a -> canonicalizePath a++  makeAbsolute s = case s of+    Abs a -> makeAbsolute a+    Rel a -> makeAbsolute a++  makeRelative r s = case s of+    Abs a -> makeRelative r a+    Rel a -> makeRelative r a++  makeRelativeToCurrentDir s = case s of+    Abs a -> makeRelativeToCurrentDir a+    Rel a -> makeRelativeToCurrentDir a++-- | @since 1.8.0+instance AnyPath (SomeBase Dir) where+  type AbsPath (SomeBase Dir) = Path Abs Dir+  type RelPath (SomeBase Dir) = Path Rel Dir++  canonicalizePath s = case s of+    Abs a -> canonicalizePath a+    Rel a -> canonicalizePath a++  makeAbsolute s = case s of+    Abs a -> makeAbsolute a+    Rel a -> makeAbsolute a++  makeRelative r s = case s of+    Abs a -> makeRelative r a+    Rel a -> makeRelative r a++  makeRelativeToCurrentDir s = case s of+    Abs a -> makeRelativeToCurrentDir a+    Rel a -> makeRelativeToCurrentDir a+ -- | Append stringly-typed path to an absolute path and then canonicalize -- it. --
path-io.cabal view
@@ -1,11 +1,11 @@ cabal-version:   2.4 name:            path-io-version:         1.7.0+version:         1.8.0 license:         BSD-3-Clause license-file:    LICENSE.md maintainer:      Mark Karpov <markkarpov92@gmail.com> author:          Mark Karpov <markkarpov92@gmail.com>-tested-with:     ghc ==8.10.7 ghc ==9.0.2 ghc ==9.2.1+tested-with:     ghc ==9.0.2 ghc ==9.2.4 ghc ==9.4.1 homepage:        https://github.com/mrkkrp/path-io bug-reports:     https://github.com/mrkkrp/path-io/issues synopsis:        Interface to ‘directory’ package for users of ‘path’@@ -29,13 +29,13 @@     exposed-modules:  Path.IO     default-language: Haskell2010     build-depends:-        base >=4.13 && <5.0,+        base >=4.15 && <5.0,         containers,         directory >=1.3.2.0 && <1.4,         dlist >=0.8 && <2.0,         exceptions >=0.8 && <0.11,         filepath >=1.2 && <1.5,-        path >=0.6 && <0.10,+        path >=0.7.1 && <0.10,         temporary >=1.1 && <1.4,         time >=1.4 && <1.13,         transformers >=0.3 && <0.7,@@ -58,12 +58,12 @@     hs-source-dirs:   tests     default-language: Haskell2010     build-depends:-        base >=4.13 && <5.0,+        base >=4.15 && <5.0,         directory >=1.3.2.0 && <1.4,         exceptions >=0.8 && <0.11,         hspec >=2.0 && <3.0,         filepath >=1.2 && <1.5,-        path >=0.6 && <0.10,+        path >=0.7.1 && <0.10,         path-io,         transformers >=0.3 && <0.7,         unix-compat