         return base[index.base]
     }
     
-    public func generate() -> LazyReplaceRangeGenerator<C, S> {
+    public func generate() -> LazyReplaceRangeGenerator<C.SubSequence.Generator, S.Generator> {
         return LazyReplaceRangeGenerator(base: base.generate())
     }
     


public struct LazyReplaceRangeBidirectionalCollection<C : CollectionType, S : CollectionType where C.SubSequence : CollectionType, C.SubSequence.Index : BidirectionalIndexType, S.Index : BidirectionalIndexType, C.SubSequence.Generator.Element == S.Generator.Element> : LazyCollectionType {
    
    public typealias Generator = LazyReplaceRangeGenerator<C, S>
    
    private var base : ConcatBidirectionalCollection<ConcatBidirectionalCollection<C.SubSequence, S>, C.SubSequence>
    
    private init(base: C, subRange: Range<C.Index>, with newElements: S) {
        self.base = base.prefixUpTo(subRange.startIndex).concat(newElements).concat(base.suffixFrom(subRange.endIndex))

        return base[index.base]
    }
    
    public func generate() -> LazyReplaceRangeGenerator<C.SubSequence.Generator, S.Generator> {
        return LazyReplaceRangeGenerator(base: base.generate())
    }
    
