Unit Type

In the area of mathematical logic and computer science known as type theory, a unit type is a type that allows only one value (and thus can hold no information). The carrier (underlying set) associated with a unit type can be any singleton set. There is an isomorphism between any two such sets, so it is customary to talk about the unit type and ignore the details of its value. One may also regard the unit type as the type of 0-tuples, i.e. the product of no types.

The unit type is the terminal object in the category of types and typed functions. It should not be confused with the zero or bottom type, which allows no values and is the initial object in this category.

The unit type is implemented in most functional programming languages. The void type that is used in some imperative programming languages serves some of its functions, but because its carrier set is empty, there are some limitations (as detailed below).

Read more about Unit Type:  In Programming Languages

Famous quotes containing the words unit and/or type:

    During the Suffragette revolt of 1913 I ... [urged] that what was needed was not the vote, but a constitutional amendment enacting that all representative bodies shall consist of women and men in equal numbers, whether elected or nominated or coopted or registered or picked up in the street like a coroner’s jury. In the case of elected bodies the only way of effecting this is by the Coupled Vote. The representative unit must not be a man or a woman but a man and a woman.
    George Bernard Shaw (1856–1950)

    Histories of the world omitted China; if a Chinaman invented compass or movable type or gunpowder we promptly “forgot it” and named their European inventors. In short, we regarded China as a sort of different and quite inconsequential planet.
    —W.E.B. (William Edward Burghardt)