From 73f330a62e07d677ada75ff72e05bb872fa0bd40 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2021 12:57:54 -0400 Subject: [PATCH] document an important property of relPathCwdToFile --- Utility/Path/AbsRel.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Utility/Path/AbsRel.hs b/Utility/Path/AbsRel.hs index 0026bd6a19..951d0aa1b8 100644 --- a/Utility/Path/AbsRel.hs +++ b/Utility/Path/AbsRel.hs @@ -64,11 +64,12 @@ absPath file #endif return $ absPathFrom cwd file -{- Constructs a relative path from the CWD to a file. +{- Constructs the minimal relative path from the CWD to a file. - - For example, assuming CWD is /tmp/foo/bar: - relPathCwdToFile "/tmp/foo" == ".." - relPathCwdToFile "/tmp/foo/bar" == "" + - relPathCwdToFile "../bar/baz" == "baz" -} relPathCwdToFile :: RawFilePath -> IO RawFilePath relPathCwdToFile f = do @@ -79,7 +80,7 @@ relPathCwdToFile f = do #endif relPathDirToFile c f -{- Constructs a relative path from a directory to a file. -} +{- Constructs a minimal relative path from a directory to a file. -} relPathDirToFile :: RawFilePath -> RawFilePath -> IO RawFilePath relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to -- 2.30.2