setTypeForSizesContentType

fun setTypeForSizesContentType(sizeRange: A_Type, contentType: A_Type): A_Type

Create a set type with the given range of sizes and content type. Normalize it certain ways:

  • An enumeration for the size range is weakened to a kind.

  • A ⊥ content type implies exactly zero elements, or ⊥ as the resulting set type if zero is not an allowed size.

  • At most zero elements implies a ⊥ content type.

  • A non-meta enumeration for the content bounds the maximum size of the set (e.g., a set of booleans has at most 2 elements).

  • Similarly, an integral range for the content type bounds the maximum size of the set (you can't have a 1000-element set of bytes).

Return

An immutable set type as specified.

Parameters

sizeRange

The allowed sizes of my instances.

contentType

The type that constrains my instances' elements.