Nil

Nil is Gleam's unit type. It is a value that is returned by functions that have nothing else to return, as all functions must return something.

Nil is not a valid value of any other types. Therefore, values in Gleam are not nullable. If the type of a value is Nil then it is the value Nil. If it is some other type then the value is not Nil.

Uncomment the line that assigns Nil to a variable with an incompatible type annotation to see the compile time error it produces.