import { Err, Result } from "../result"; import { Type } from "../type"; export class Value extends Type { readonly val: T; constructor(v: T) { super(); this.val = v; } check(val: any): Result { if(val === this.val) return val; return new Err(`${val} is not equal to ${this.val}`); } } export function value(v: T): Value { return new Value(v); }