         return ParserInput(stream.dropLast(n), at: location)
     }
 
+    public func split(maxSplits: Int, omittingEmptySubsequences: Bool,
+                      whereSeparator isSeparator: (Character) throws -> Bool) rethrows -> [ParserInput] {
+        return try stream.split(maxSplits: maxSplits,
+                                omittingEmptySubsequences: omittingEmptySubsequences,
+                                whereSeparator: isSeparator).map { sub in ParserInput(sub) }
+    }
+
 }
 
 extension ParserInput : CustomStringConvertible {

        }
    }

    public func apply<MapTarget>(_ transform: Parser<@escaping (Output) -> MapTarget>) -> Parser<MapTarget> {
        return Parser<MapTarget> { input in
            let (out1, rest1) = try transform.run(input)
            let (out2, rest2) = try self.run(rest1)


extension ParserInput : Sequence {

    public func prefix(_ maxLength: Int) -> ParserInput {
        return ParserInput(stream.prefix(maxLength), at: location)
    }

    public func prefix(while predicate: (Character) throws -> Bool) rethrows -> ParserInput {
        return try ParserInput(stream.prefix(while: predicate), at: location)
    }

    public func suffix(_ maxLength: Int) -> ParserInput {
        return ParserInput(stream.suffix(maxLength), at: location)
    }
