Previous: Higher-order function applications, Up: Data-terms   [Contents]


2.15.7 Explicit type qualification

Explicit type qualifications are occasionally useful to resolve ambiguities that can arise from overloading or polymorphic types.

An explicit type qualification expression is a term of the form

Term : Type

Term must be a valid data-term. Type must be a valid type (see Types).

An explicit type qualification expression constrains the specified term to have the specified type. Apart from that, the meaning of an explicit type qualification expression is just the same as the specified Term.

Currently we also support the following alternative syntax for type qualification:

with_type(Term, Type)

or equivalently, as it is more commonly written,

Term `with_type` Type