type OptionError := { option: T | null, message: String, type: "OptionError" } type TypedError := { message: String, type: T } type ValidationError := { errors: Array, message: String, type: "ValidationError" } error/option := (String, T) => OptionError error/typed := (args: { message: String, type: String, name?: String }) => (opts: Object) => TypedError error/validation := (Array) => ValidationError