export type Ok = { ok: true; value: T }; export type Err = { ok: false; error: E }; export type Result = Ok | Err; export const Ok = (value: T): Ok => ({ ok: true, value }); export const Err = (error: E): Err => ({ ok: false, error }); export type Some = { some: true; value: T }; export type None = { some: false }; export type Option = Some | None; export const Some = (value: T): Some => ({ some: true, value }); export const None: None = { some: false } as const; export const _ = Symbol("_"); export type _ = typeof _;