CurryInfo: filepath-3.0.0 / System.FilePath.dropTrailingPathSeparator

definition:
dropTrailingPathSeparator :: FilePath -> FilePath
dropTrailingPathSeparator x =
    if hasTrailingPathSeparator x && not (isDrive x)
    then let x' = reverse $ dropWhile isPathSeparator $ reverse x
         in if null x' then [pathSeparator] else x'
    else x
demand:
argument 1
deterministic:
deterministic operation
documentation:
-- | Remove any trailing path separators
--
-- > dropTrailingPathSeparator "file/test/" == "file/test"
-- > Posix:    not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x
-- > Posix:    dropTrailingPathSeparator "/" == "/"
-- > Windows:  dropTrailingPathSeparator "\\" == "\\"
failfree:
_
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_) |-> _}
name:
dropTrailingPathSeparator
precedence:
no precedence defined
result-values:
_
signature:
String -> String
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term