Unit is a special type in Unison with a single value, instatiated by ()
. Its representation in type signatures is also written ()
.
Unit is used to represent the absence of a returned value, or a value that carries no information. It's often used as a return type for functions that perform effects. It signifies that something has been done, but that no meaningful value was otherwise produced.
For example, printLine : Text ->{IO, Exception} ()
returns Unit because it performs the effect of printing a line to the console, but the act of printing doesn't produce a value beyond the effect itself.