Like nushio said, both Client
and Server
are completely symmetric each other. The only thing that introduces asymmetry is the composition operator. (>->
) begins at the Client
end and (>~>
) begins at the Server
end.
Since you are using (>->
), that means that the Client
component has "the initiative" and gets things rolling. This means that the Server
will not do anything unless the Client
makes a request
. Other than the fact that the Client
begins first, there is no difference between the Client
and Server
.
The type of (>->
) when you specialize it to a Client
and Server
reflects this asymmetry in initiative:
(>->) => ([String] -> Server [String] String IO r)
-> (() -> Client [String] String IO r)
-> (() -> Session IO r)
The Server
(i.e. your user) only reacts to the Client
(i.e. the game engine), which is why the server must accept an argument of type [String]
to get the ball rolling. This is reflected in the fact that if the game engine never prompts the user for a choice then the user "can never run" because the user has no set of choices from which to select. From the way you specified the problem the game engine is in control, not the user. If you were to specify it the other way around and have the user drive the game engine then the roles would be reversed.