Refinement type

In type theory, a refinement type is a type endowed with a predicate which is assumed to hold for any element of the refined type. Refinement types can express preconditions when used as function arguments or postconditions when used as return types: for instance, the type of a function which accepts natural numbers and returns natural numbers greater than 5 may be written as f : N → { n ∈ N | n > 5 } {\displaystyle f:\mathbb {N} \rightarrow \{n\in \mathbb {N} \,|\,n>5\}} .

Source: Wikipedia — Refinement type (CC BY-SA 4.0)

Refinement type

In type theory, a refinement type is a type endowed with a predicate which is assumed to hold for any element of the refined type. Refinement types can express preconditions when used as function arguments or postconditions when used as return types: for instance, the type of a function which accepts natural numbers and returns natural numbers greater than 5 may be written as f : N → { n ∈ N | n > 5 } {\displaystyle f:\mathbb {N} \rightarrow \{n\in \mathbb {N} \,|\,n>5\}} .

Source: Wikipedia "Refinement type" · CC BY-SA 4.0

Share this article: X · Bluesky
Privacy Policy