From 6638cd8cc1f40e3183039186b7c5d4cccc4aa7f7 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 9 May 2016 14:40:30 +0200 Subject: [PATCH] Create HPath.IO module, adding canonicalizePath again --- hpath.cabal | 1 + src/HPath/IO.hs | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/HPath/IO.hs diff --git a/hpath.cabal b/hpath.cabal index 66f73bf..cba21dc 100644 --- a/hpath.cabal +++ b/hpath.cabal @@ -22,6 +22,7 @@ library ghc-options: -Wall -O2 c-sources: cbits/dirutils.c exposed-modules: HPath, + HPath.IO, HPath.Internal, System.Posix.Directory.Foreign, System.Posix.Directory.Traversals, diff --git a/src/HPath/IO.hs b/src/HPath/IO.hs new file mode 100644 index 0000000..e1d761f --- /dev/null +++ b/src/HPath/IO.hs @@ -0,0 +1,28 @@ +-- | +-- Module : HPath.IO +-- Copyright : © 2016 Julian Ospald +-- License : BSD 3 clause +-- +-- Maintainer : Julian Ospald +-- 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