Create HPath.IO module, adding canonicalizePath again

This commit is contained in:
Julian Ospald 2016-05-09 14:40:30 +02:00
parent 4ce35b9bec
commit 6638cd8cc1
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 29 additions and 0 deletions

View File

@ -22,6 +22,7 @@ library
ghc-options: -Wall -O2 ghc-options: -Wall -O2
c-sources: cbits/dirutils.c c-sources: cbits/dirutils.c
exposed-modules: HPath, exposed-modules: HPath,
HPath.IO,
HPath.Internal, HPath.Internal,
System.Posix.Directory.Foreign, System.Posix.Directory.Foreign,
System.Posix.Directory.Traversals, System.Posix.Directory.Traversals,

28
src/HPath/IO.hs Normal file
View File

@ -0,0 +1,28 @@
-- |
-- Module : HPath.IO
-- Copyright : © 2016 Julian Ospald
-- License : BSD 3 clause
--
-- Maintainer : Julian Ospald <hasufell@posteo.de>
-- Stability : experimental
-- Portability : portable
--
-- IO operations on HPath.
{-# OPTIONS_HADDOCK ignore-exports #-}
module HPath.IO
where
import HPath
import HPath.Internal
import System.Posix.Directory.Traversals (realpath)
-- | May fail on `realpath`.
canonicalizePath :: Path Abs -> IO (Path Abs)
canonicalizePath (MkPath l) = do
nl <- realpath l
return $ MkPath nl