 
 /// A set of unique elements.
 public struct Set<Element : Hashable> {
-	var _dictionary: Dictionary<Element, Unit> = [:]
-	
 	public init<S : SequenceType where S.Generator.Element == Element>(_ sequence: S) {
 		extend(sequence)
 	}

/// Does not actually conform to Collection because that crashes the compiler.
extension Set {
	typealias IndexType = DictionaryIndex<Element, Unit>
	var startIndex: IndexType { return _dictionary.startIndex }
	var endIndex: IndexType { return _dictionary.endIndex }
	
	subscript(index: IndexType) -> Element {
		return _dictionary[index].0
	}
}


	public init() {}
	
	
	public var count: Int { return values.count }
	
	public func contains(element: Element) -> Bool {
		return values[element] != nil
	}
	
	public mutating func insert(element: Element) {
		values[element] = Unit()
	}
	
	public mutating func remove(element: Element) {
		values.removeValueForKey(element)
	}

	private var values: Dictionary<Element, Unit> = [:]
}


/// Sequence conformance.
extension Set : SequenceType {
	public func generate() -> GeneratorOf<Element> {
		var generator = values.keys.generate()
		return GeneratorOf {
			return generator.next()
		}
