Skip to content

Commit e148a0f

Browse files
committed
Add ParserResult type constructor
1 parent 9e24f8a commit e148a0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ export type InvalidInputError = {
66
readonly message: string
77
}
88

9-
export type Parser<Output> = (
10-
input: string,
11-
) => Either<InvalidInputError, Success<Output>>
9+
export type Parser<Output> = (input: string) => ParserResult<Output>
1210

1311
export type ParserWhichAlwaysSucceeds<Output> = (
1412
input: string,
1513
) => Right<Success<Output>>
1614

15+
export type ParserResult<Output> = Either<InvalidInputError, Success<Output>>
16+
1717
export type Success<Output> = {
1818
readonly remainingInput: string
1919
readonly output: Output

0 commit comments

Comments
 (0)