This module implements relative paths within a Tree. All paths are anchored at a certain root (this is usually the Tree root). They are represented by a list of Names (these are just strict bytestrings).
- newtype Name = Name ByteString
- newtype AnchoredPath = AnchoredPath [Name]
- anchoredRoot :: AnchoredPath
- appendPath :: AnchoredPath -> Name -> AnchoredPath
- anchorPath :: FilePath -> AnchoredPath -> FilePath
- isPrefix :: AnchoredPath -> AnchoredPath -> Bool
- parent :: AnchoredPath -> AnchoredPath
- parents :: AnchoredPath -> [AnchoredPath]
- catPaths :: AnchoredPath -> AnchoredPath -> AnchoredPath
- flatten :: AnchoredPath -> ByteString
- makeName :: String -> Name
- floatBS :: ByteString -> AnchoredPath
- floatPath :: FilePath -> AnchoredPath
Check whether a path is a prefix of another path.
List all parents of a given path. foobarbaz -> [foo, foo/bar]
Catenate two paths together. Not very safe, but sometimes useful (e.g. when you are representing paths relative to a different point than a Tree root).