diff options
author | Hans Bolinder <[email protected]> | 2019-06-25 08:20:01 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2019-06-25 08:20:01 +0200 |
commit | 09abac433a59f0644316a54f61ade7132db673d1 (patch) | |
tree | 5b7e584757df0e447d35b6644adcefb82694e9c5 /system | |
parent | 5e361ced7f4466a08df2490e951d35c389cc584a (diff) | |
parent | d0a08a7b8a8d4dd8d825f5bc0d2ee9687c549516 (diff) | |
download | otp-09abac433a59f0644316a54f61ade7132db673d1.tar.gz otp-09abac433a59f0644316a54f61ade7132db673d1.tar.bz2 otp-09abac433a59f0644316a54f61ade7132db673d1.zip |
Merge branch 'kostis/doc/map-type-is-an-alias' into maint
* kostis/doc/map-type-is-an-alias:
The map() type is an alias; not a predefined type
Diffstat (limited to 'system')
-rw-r--r-- | system/doc/reference_manual/typespec.xml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/system/doc/reference_manual/typespec.xml b/system/doc/reference_manual/typespec.xml index 27cd0ba83d..f517259a64 100644 --- a/system/doc/reference_manual/typespec.xml +++ b/system/doc/reference_manual/typespec.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2018</year> + <year>2003</year><year>2019</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -140,8 +140,7 @@ | nonempty_improper_list(Type1, Type2) %% Type1 and Type2 as above | nonempty_list(Type) %% Proper non-empty list - Map :: map() %% denotes a map of any size - | #{} %% denotes the empty map + Map :: #{} %% denotes the empty map | #{AssociationList} Tuple :: tuple() %% denotes a tuple of any size @@ -192,17 +191,16 @@ <c>AssociationList</c> are allowed to overlap, and if they do, the leftmost association takes precedence. A map association has a key in <c>AssociationList</c> if it belongs to this type. - <c>AssociationList</c> can contain both mandatory and optional - association types. + <c>AssociationList</c> can contain both mandatory <c>(:=)</c> and + optional <c>(=>)</c> association types. If an association type is mandatory, an association with that type - is to be present. + needs to be present. In the case of an optional association type it is not required for the key type to be present. </p> <p> - Notice that the syntactic representation of <c>map()</c> is - <c>#{any() => any()}</c> (or <c>#{_ => _}</c>), not <c>#{}</c>. The notation <c>#{}</c> specifies the singleton type for the empty map. + Note that this notation is not a shorthand for the <c>map()</c> type. </p> <p> For convenience, the following types are also built-in. @@ -259,6 +257,9 @@ <cell><c>iolist()</c></cell><cell><c>maybe_improper_list(byte() | binary() | iolist(), binary() | [])</c></cell> </row> <row> + <cell><c>map()</c></cell><cell><c>#{any() => any()}</c></cell> + </row> + <row> <cell><c>function()</c></cell><cell><c>fun()</c></cell> </row> <row> |