 public func seq<T, U, StreamToken>(
   _ left: @autoclosure @escaping () -> HeterogeneousParser<StreamToken, T>,
   _ right: @autoclosure @escaping () -> HeterogeneousParser<StreamToken, U>
-) -> ([StreamToken]) -> ((T, U), [StreamToken])? {
+) -> HeterogeneousParser<StreamToken, (T, U)> {
   return { source in
     return left()(source).flatMap { leftResult in
       return right()(leftResult.1).map { rightResult in

public func ~<T, U, StreamToken>(
  _ left: @autoclosure @escaping () -> HeterogeneousParser<StreamToken, T>,
  _ right: @autoclosure @escaping () -> HeterogeneousParser<StreamToken, U>
  ) -> ([StreamToken]) -> ((T, U), [StreamToken])? {
  return seq(left, right)
}


}

// Generate parser which matches 1 or more of `parser` arugment.
public func rep1<T, StreamToken>(_ parser: @autoclosure @escaping () -> HeterogeneousParser<StreamToken, T>) -> HeterogeneousParser<StreamToken, [T]> {
  return { source in
    return seq(parser, rep(parser))(source).map { result in
      return ([result.0.0] + result.0.1, result.1)
