     }
     return false
 }
-
-/// Private function that normalizes and returns an absolute string.  Asserts
-/// that `string` starts with a path separator.
-///
-/// The normalization rules are as described for the AbsolutePath struct.
-private func normalize(absolute string: String) -> String {
-  #if os(Windows)
-    return string.standardizingPath
-  #else
-    precondition(string.first == "/", "Failure normalizing \(string), absolute paths should start with '/'")
-
-    // At this point we expect to have a path separator as first character.
-    assert(string.first == "/")
-    // Fast path.
-    if !mayNeedNormalization(absolute: string) {
-        return string
-    }
-
-    // Split the character array into parts, folding components as we go.
-    // As we do so, we count the number of characters we'll end up with in
-    // the normalized string representation.
-    var parts: [String] = []
-    var capacity = 0
-    for part in string.split(separator: "/") {
-        switch part.count {
-          case 0:
-            // Ignore empty path components.
-            continue
-          case 1 where part.first == ".":
-            // Ignore `.` path components.
-            continue
-          case 2 where part.first == "." && part.last == ".":
-            // If there's a previous part, drop it; otherwise, do nothing.
-            if let prev = parts.last {
-                parts.removeLast()
-                capacity -= prev.count
-            }
-          default:
-            // Any other component gets appended.
-            parts.append(String(part))
-            capacity += part.count
-        }
-    }
-    capacity += max(parts.count, 1)
-
-    // Create an output buffer using the capacity we've calculated.
-    // FIXME: Determine the most efficient way to reassemble a string.
-    var result = ""
-    result.reserveCapacity(capacity)
-
-    // Put the normalized parts back together again.
-    var iter = parts.makeIterator()
-    result.append("/")
-    if let first = iter.next() {
-        result.append(contentsOf: first)
-        while let next = iter.next() {
-            result.append("/")
-            result.append(contentsOf: next)
-        }
-    }
-
-    // Sanity-check the result (including the capacity we reserved).
-    assert(!result.isEmpty, "unexpected empty string")
-    assert(result.count == capacity, "count: " +
-        "\(result.count), cap: \(capacity)")
-
-    // Use the result as our stored string.
-    return result
-  #endif
-}
-
-/// Private function that normalizes and returns a relative string.  Asserts
-/// that `string` does not start with a path separator.
-///
-/// The normalization rules are as described for the AbsolutePath struct.
-private func normalize(relative string: String) -> String {
-  #if os(Windows)
-    return string.standardizingPath
-  #else
-    precondition(string.first != "/")
-
-    // FIXME: Here we should also keep track of whether anything actually has
-    // to be changed in the string, and if not, just return the existing one.
-
-    // Split the character array into parts, folding components as we go.
-    // As we do so, we count the number of characters we'll end up with in
-    // the normalized string representation.
-    var parts: [String] = []
-    var capacity = 0
-    for part in string.split(separator: "/") {
-        switch part.count {
-        case 0:
-            // Ignore empty path components.
-            continue
-        case 1 where part.first == ".":
-            // Ignore `.` path components.
-            continue
-        case 2 where part.first == "." && part.last == ".":
-            // If at beginning, fall through to treat the `..` literally.
-            guard let prev = parts.last else {
-                fallthrough
-            }
-            // If previous component is anything other than `..`, drop it.
-            if !(prev.count == 2 && prev.first == "." && prev.last == ".") {
-                parts.removeLast()
-                capacity -= prev.count
-                continue
-            }
-            // Otherwise, fall through to treat the `..` literally.
-            fallthrough
-        default:
-            // Any other component gets appended.
-            parts.append(String(part))
-            capacity += part.count
-        }
-    }
-    capacity += max(parts.count - 1, 0)
-
-    // Create an output buffer using the capacity we've calculated.
-    // FIXME: Determine the most efficient way to reassemble a string.
-    var result = ""
-    result.reserveCapacity(capacity)
-
-    // Put the normalized parts back together again.
-    var iter = parts.makeIterator()
-    if let first = iter.next() {
-        result.append(contentsOf: first)
-        while let next = iter.next() {
-            result.append("/")
-            result.append(contentsOf: next)
-        }
-    }
-
-    // Sanity-check the result (including the capacity we reserved).
-    assert(result.count == capacity, "count: " +
-        "\(result.count), cap: \(capacity)")
-
-    // If the result is empty, return `.`, otherwise we return it as a string.
-    return result.isEmpty ? "." : result
-  #endif
-}

    /// and `RelativePath`; particular file systems may have their own
    /// additional requirements.
    static func isValidComponent(_ name: String) -> Bool {
        return name != "" && name != "." && name != ".." && !name.contains("/")
    }

    /// Private implementation details, shared with the RelativePath struct.


    /// Convenience initializer that verifies that the path is absolute.
    public init(validating path: String) throws {
        try self.init(PathImpl(validatingAbsolutePath: path))
    }

    /// Directory component.  An absolute path always has a non-empty directory
