Refinement Types is an actively used design pattern. A type endowed with a predicate which is assumed to hold for any element of the refined type.
- the Refinement Types wikipedia page
- Have a question about Refinement Types not answered here? Email me and let me know how I can help.
Languages with Refinement Types include raku
Example from raku:
subset Color of Any where Color | CMYK_Color;
Last updated February 18th, 2020