Essentially this, but with a better name:
|
fromTarPathInternal :: PosixChar -> TarPath -> PosixString |
|
fromTarPathInternal sep = go |
|
where |
|
posixSep = PS.unsafeFromChar FilePath.Posix.pathSeparator |
|
adjustSeps = if sep == posixSep then id else |
|
PS.map $ \c -> if c == posixSep then sep else c |
|
go (TarPath name prefix) |
|
| PS.null prefix = adjustSeps name |
|
| PS.null name = adjustSeps prefix |
|
| otherwise = adjustSeps prefix <> PS.cons sep (adjustSeps name) |
Or maybe just expose data TarPath from somewhere?..
Essentially this, but with a better name:
tar/Codec/Archive/Tar/Types.hs
Lines 418 to 427 in 29ac5b5
Or maybe just expose
data TarPathfrom somewhere?..