Improve and abstract Cursor design. Start scanner
This commit is contained in:
parent
d382b16e6d
commit
d5f9777711
8 changed files with 713 additions and 476 deletions
10
src/result.ts
Normal file
10
src/result.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
export type Result<T, E> =
|
||||
| { tag: "ok", value: T }
|
||||
| { tag: "error", error: E }
|
||||
|
||||
export namespace Result {
|
||||
export function ok<T, E>(value: T): Result<T, E> { return { tag: "ok", value } }
|
||||
export function error<T, E>(error: E): Result<T, E> { return { tag: "error", error } }
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue