 //  Copyright (c) 2014 Rob Rix. All rights reserved.
 
 /// A set of unique elements.
-struct Set<Element : Hashable> {
+public struct Set<Element : Hashable> {
 	var _dictionary: Dictionary<Element, Unit> = [:]
 	
-	init<S : SequenceType where S.Generator.Element == Element>(_ sequence: S) {
+	public init<S : SequenceType where S.Generator.Element == Element>(_ sequence: S) {
 		extend(sequence)
 	}
 	
-	init() {}
+	public init() {}
 	
 	
-	var count: Int { return _dictionary.count }
+	public var count: Int { return _dictionary.count }
 	
-	func contains(element: Element) -> Bool {
+	public func contains(element: Element) -> Bool {
 		return _dictionary[element] != nil
 	}
 	
-	mutating func insert(element: Element) {
+	public mutating func insert(element: Element) {
 		_dictionary[element] = Unit()
 	}
 	
-	mutating func remove(element: Element) {
+	public mutating func remove(element: Element) {
 		_dictionary.removeValueForKey(element)
 	}
 }


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



/// Creates and returns the union of \c set and \c sequence.
public func + <S : SequenceType> (set: Set<S.Generator.Element>, sequence: S) -> Set<S.Generator.Element> {
	var union = Set(set)
	union += sequence
	return union
