 public func ==<T>(lhs: Set<T>, rhs: Set<T>) -> Bool {
     return lhs.isEqualToSet(rhs)
 }
+
+// MARK: - SetIndex
+
+public struct SetIndex<T: Hashable> : BidirectionalIndexType {
+    private var index: DictionaryIndex<T, Bool>
+    private init(_ dictionaryIndex: DictionaryIndex<T, Bool>) {
+        self.index = dictionaryIndex
+    }
+    public func predecessor() -> SetIndex<T> {
+        return SetIndex(self.index.predecessor())
+    }
+    public func successor() -> SetIndex<T> {
+        return SetIndex(self.index.successor())
+    }
+}
+
+public func ==<T: Hashable>(lhs: SetIndex<T>, rhs: SetIndex<T>) -> Bool {
+    return lhs.index == rhs.index
+}

// MARK: ExtensibleCollectionType

extension Set : ExtensibleCollectionType {
    typealias Index = Int
    public var startIndex: Int { return 0 }
    public var endIndex: Int { return self.count }

    public subscript(i: Int) -> Element {
        return Array(self.contents.keys)[i]
    }

    public mutating func reserveCapacity(n: Int) {

    /// Returns `true` if the Set contains `element`.
    public func contains(element: Element) -> Bool {
        return contents[element] ?? false
    }

    /// `true` if the Set contains `element`, `false` otherwise.
    public subscript(element: Element) -> Bool {
        return contains(element)
    }

    /// Add `newElements` to the Set.
