         return result.count > 0
     }
     
-    public func groupBy<U>(@noescape filterFunc: (Self.Generator.Element) -> U) -> [U : Set<Self.Generator.Element>] {
+    public func groupBy<U>(@noescape filterFunc: (Generator.Element) -> U) -> [U : PartitionSequence<Generator.Element>] {
         var result = [U: Set<Generator.Element>]()
         for i in self {
             let u = filterFunc(i)

    return Set(e)
}

extension SequenceType where Generator.Element : Hashable {
    
    public func partition(@noescape filterFunc: (Self.Generator.Element) -> Bool) -> (Set<Self.Generator.Element>, Set<Self.Generator.Element>) {
        let result1 = self.filter(filterFunc)
        let result2 = self.filter{!filterFunc($0)}
        return (Set(result1), Set(result2))
    }
    
    public func hasElementPassingTest(@noescape filterFunc: (Self.Generator.Element) -> Bool) -> Bool {

    public func flatten() -> Self {
        return self
    }
    
}

extension Set: Flattenable {
