 ///
 /// See Cursor.map(_:)
 public final class MapCursor<Base: Cursor, Element> : Cursor {
+    private let base: Base
+    private let transform: (Base.Element) throws -> Element
+    
     init(_ base: Base, _ transform: @escaping (Base.Element) throws -> Element) {
         self.base = base
         self.transform = transform

    
    /// Returns a cursor over the concatenated results of mapping transform
    /// over self.
    public func flatMap<SegmentOfResult: Cursor>(_ transform: @escaping (Iterator.Element) throws -> SegmentOfResult) -> FlattenCursor<MapCursor<IteratorCursor<Self.Iterator>, SegmentOfResult>> {
        return IteratorCursor(self).flatMap(transform)
    }
}

        defer { index += 1 }
        return (index, element)
    }
}

/// A cursor whose elements consist of the elements of some base cursor that
/// also satisfy a given predicate.
public final class FilterCursor<Base: Cursor> : Cursor {
    private let base: Base
    private let isIncluded: (Base.Element) throws -> Bool
    
    init(_ base: Base, _ isIncluded: @escaping (Base.Element) throws -> Bool) {
        self.base = base
        self.isIncluded = isIncluded
