Skip to content

TRPL: Explain Bottom and Unit Types #25244

Closed
@killercup

Description

@killercup

The book currently lacks any mention of these two special types:

  • The bottom type, !, which denotes there is no type (this e.g. the type of a function that does not return) and
  • the unit type, (), which is basically an empty tuple and thus a type with exactly one variant.

@steveklabnik, I wanted to make a PR for this, but I wasn't sure where to add this. The "Primitive Types" chapter seems to cover the topic of types, but people read about bool, str and i32 are probably not looking for type theory material…

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions