message: typing tweaks
diff: @@ -23,7 +23,6 @@ export class MonadicParser<A> {
  return { success: false, index: makeLineColumnIndex(input, result.furthest), expected: result.expected };
  };
  -
  tryParse(str: string) {
  const result = this.parse(str);
  if (result.success) {
  @@ -121,7 +120,6 @@ export class MonadicParser<A> {
  return MonadicParser.seq(this.times(n), this.many()).map(r => [...r[0], ...r[1]]);
  };
  -
  map<B>(f: (a: A) => B): MonadicParser<B> {
  return new MonadicParser((input, i) => {
  const result = this._(input, i);
  @@ -239,8 +237,7 @@ export namespace MonadicParser {
  export type Result<T> = Success<T> | Failure
  -
  - export function seqMap(a: MonadicParser<any>, b: MonadicParser<any>, c: any) {
  + export function seqMap<A, B>(a: MonadicParser<A>, b: MonadicParser<B>, c: any) {
  const args = [].slice.call(arguments);
  if (args.length === 0) {
  throw new Error('seqMap needs at least one argument');
  @@ -262,7 +259,6 @@ export namespace MonadicParser {
  return language;
  }
  -
  export function seq<A>(a: MonadicParser<A>): MonadicParser<[A]>
  export function seq<A, B>(a: MonadicParser<A>, b: MonadicParser<B>): MonadicParser<[A, B]>
  export function seq<A, B, C>(a: MonadicParser<A>, b: MonadicParser<B>, c: MonadicParser<C>): MonadicParser<[A, B, C]>
  @@ -342,11 +338,10 @@ export namespace MonadicParser {
  return RegExp('^(?:' + re.source + ')', flags(re));
  }
  -
  export function regexp(re: RegExp, group = 0) {
  const anchored = anchoredRegexp(re);
  const expected = '' + re;
  - return new MonadicParser<any>(function (input: any, i: any) {
  + return new MonadicParser((input, i) => {
  const match = anchored.exec(input.slice(i));
  if (match) {
  if (0 <= group && group <= match.length) {
  @@ -476,12 +471,12 @@ export namespace MonadicParser {
  export const newline = alt(crlf, lf, cr).desc('newline');
  export const end = alt(newline, eof);
  - export function of(A: any) {
  - return succeed(A);
  + export function of<A>(value: A) {
  + return succeed(value);
  }
  - export function regex(A: any) {
  - return regexp(A);
  + export function regex(re: RegExp) {
  + return regexp(re);
  }
  MonadicParser.createLanguage = createLanguage;
  @@ -594,5 +589,3 @@ function assertFunction(x: any) {
  throw new Error('not a function: ' + x);
  }
  }
  -
  -
  