Separate a value from its wrapper

A sensor application defines the value domain of a type as the set of values that type permits. It uses these three types:

  • Reading permits exactly the integers from −2 through 2, inclusive.
  • Flag permits exactly the Boolean values true and false. These values are distinct from integers.
  • OptionalReading permits exactly Missing or Present(r), where r is a permitted Reading value. The names Missing and Present identify different alternatives.

No automatic conversions or wrapping occur. Enter Yes or No in each cell to indicate whether the candidate value belongs to the column's type.

Candidate valueReadingFlagOptionalReading
2
true
Present(-2)
Present(3)
Missing

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Type Systems Questions: