This chapter clarifies all types.
To Pickup the overview more quickly they can be viewed in the following list.
Every decision and further specification are explained in the corresponding sub-chapters respectively.
|Bool||A value of type boolean can be either |
|Int||TODO: The classical integer type with 32-bit or 64-bit depending on the current system?|
|Float||A float with 64 bits?|
|String||A string of any unicode characters|
|Path||Path referencing a location or a file. With no assumptions on the existence of that|
|Null||The value null|
Any type is often used to explicitly allow arbitrary values. However,
the Any type is complex and doesn't add much value to a type system. Instead, we should use type variables whenever possible.
Interestingly there are two different
e.g. If we look at CUE-lang (which is also inspired by nix)
CUE defines the values bottom, or error, (denoted |) that is an instance of all types and top, or any, (denoted _) of which all types are an instance.
TOP anyall types are an instance of that. You can imagine it as the TOP-most set, that includes every type. But no value has that type.
Bottom anywhich is an instance of all types. This is kind of the imaginary value that has the any type. Still, doesn't contain any value. Which could also be denoted:
Empty Typeit is a type that is the subtype of any type.
The following is a nice quote from the Typescript world
The any type is so dangerous because it exists outside of the type tree. It is both a top and bottom type. Everything can be assigned to it and it can be assigned to everything else. ...
U, ...; are placeholders for any types, those MUST be specifically declared on usage
|List||List of elements with type ||List|
|AttrSet||AttrSet where member ||AttrSet|
|Lambda||A function that takes a single argument of type ||lambda|
More details how to use complex types in the corresponding chapters
|There is no |
used operators are defined in the operators chapter