Age (usually of people)
An integer between 0 and 255, inclusive.
A number between 0 and 360, inclusive of 0, exclusive of 360.
Other values are mathematically valid, but are constrained here for implementation convenience and reliability. Use mod360 to coerce to this range.
Integer age (usually of people)
An integer.
An amount of money.
The unit interval: a number between 0 and 1, inclusive.
Interest/growth rate as a fraction (not percent).
Relax the type checking on tagged types. You can use typeguards and validators to convert back to the unrelaxed version by checking.
the type being relaxed.
the tag being removed. Defaults for simple types, must be supplied for recursive.
Create a tag for a tagged type. A tagged type is a compile-time-only thing that limits the intensional use of a type, and traces type validations.
The tag (as a string literal type) of a tagged type.
Create a taggged type. A tagged type is is a compile-time-only thing that limits the intensional use of a type, and traces type validations.
A tax rate (as a fraction, not percentage).
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
A function that coerces to a specified type.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
The unit interval: a number between 0 and 1, inclusive.
The base type of T without the Tag.
Year as an integer.
A type-inferred cast to a Tagged type. This is primarily intended for use with constants, where supplying the correct type can be determined by inspection
Generally the type parameters will be inferred.
let foo: Integer = as(1);
the tag type
the base (untagged) type.
a value in the base type
n
cast to be of the expected Tagged<T,B> type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Coerce an unknown value to a number. Strings and other things coercible to numbers will be converted. An error will be thrown if the result does not satisfy isNumber.
a number, or something coerced to a number
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Coerce an unknown value to a string. Numbers will be converted.
a number, or something coerced to a number
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
Assert that the argument n is of the type Tagged<T,B>. The compiler's type inferencing is informed that the return value has been validated to be of that type.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
Type guard for numbers.
true
if the argument n is a number, not a NaN
, and finite.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
Type guard for strings.
true
if the argument n is a string.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
A type guard. Returns true
if the argument n satisfies the conditions to be of
type T, and informs the compiler's type inferencing engine.
Create functions to test and assert membership in a tagged numerical range.
the type tag
the specification of the range to be enforced.
a DomainFns with the test and assert functions.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
A function that coerces to a specified type.
Convert a TypeAssertion for type T into one for T | undefined
.
an existing typeguard.
Convert a TypeCoercion for type T into one for T | undefined
.
Generated using TypeDoc
Teach the compiler about type checking for constrained types.