Skip to content

Commit 9e23c8a

Browse files
committed
Add better type declarations
1 parent 697d6dd commit 9e23c8a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pages_src/Tutorials/3#PropEr_testing_of_process_interaction.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The ping-pong master
1414

1515
The ping-pong master is implemented as an Erlang `gen_server`. The internal
1616
state of the server is a dictionary containing the scores (i.e. the number
17-
of ping-pong message exchanges with the master) of the ping-pong players.
17+
of ping-pong message exchanges with the master) of all ping-pong players.
1818
External clients can make the following requests:
1919

2020
* start and link to the ping-pong master
@@ -172,10 +172,11 @@ system. As usual, it specifies:
172172
* The _initial state_ of the model:
173173

174174
:::erlang
175-
-type name() :: atom().
175+
-type name() :: atom().
176+
-type score() :: non_neg_integer().
176177

177178
-record(state, {players = [] :: [name()],
178-
scores = dict:new() :: dict:dict()}).
179+
scores = dict:new() :: dict:dict(name(), score())}).
179180

180181
initial_state() -> #state{}.
181182

0 commit comments

Comments
 (0)