         // TODO: test that [1,2,3,4].prefix(2).prefix(1) is equivalent to
         // [1,2,3,4].prefix(1).
         return PrefixCursor(self, maxLength: maxLength)
+    }
+    
+    /// Returns a cursor of the initial consecutive elements that satisfy
+    /// `predicate`.
+    ///
+    /// - Parameter predicate: A closure that takes an element of the cursor as
+    ///   its argument and returns `true` if the element should be included or
+    ///   `false` otherwise. Once `predicate` returns `false` it will not be
+    ///   called again.
+    public func prefix(while predicate: @escaping (Element) throws -> Bool) -> PrefixWhileCursor<Self> {
+        return PrefixWhileCursor(self, predicate: predicate)
     }
     
     /// Returns the result of calling the given combining closure with each

        return DropFirstCursor(self, limit: n)
    }
    
    /// Returns an array containing all but the given number of final
    /// elements.
    ///

    /// this cursor's elements.
    public func map<T>(_ transform: @escaping (Element) throws -> T) -> MapCursor<Self, T> {
        return MapCursor(self, transform)
    }
    
    /// Returns a cursor, up to the specified maximum length, containing the
