From 877d8c40896408c608343333596dc8662ef17575 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 5 Apr 2016 00:54:55 +0200 Subject: [PATCH] Implement equalFilePath --- src/HPath.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/HPath.hs b/src/HPath.hs index 2c8f0c2..42e88cb 100644 --- a/src/HPath.hs +++ b/src/HPath.hs @@ -62,6 +62,7 @@ module HPath ,dropFileName ,dropTrailingPathSeparator ,dropWhileEnd + ,equalFilePath ,joinPath ,normalise ,splitDirectories @@ -499,6 +500,12 @@ isValid filepath | otherwise = True +equalFilePath :: ByteString -> ByteString -> Bool +equalFilePath p1 p2 = f p1 == f p2 + where + f x = dropTrailingPathSeparator $ normalise x + + -------------------------------------------------------------------------------- -- String based path functions