Safe Haskell | Safe |
---|
PlayerInterfaceMsg
Description
This trusted module defines the datatype of messages exchanged by
player interfaces, as well as a function for creating a player
interface message pair (send, recv)
, where send
is used to send a
message to the other player interface, and recv
is used to receive a
message from the other player interface.
Documentation
data PIMsg
Messages exchanged by player interfaces.
A DC
action returning a message pair (send, recv)
manipulating a hidden LMVar
, which is labeled dcPublic
, and
starts out empty. The DC
action will raise an exception if
dcPublic
isn't between the current label and clearance. The
current label and clearance aren't changed by the DC
action.
-
send msg
returns aDC
action that tries to put the evaluation ofmsg
into theLMVar
, blocking until this is possible, at which point()
is returned. TheDC
action will raise the current label todcPublic
; it will raise an exception if this isn't possible. The clearance won't be changed. -
recv
is aDC
action that tries to take a message from theLMVar
, blocking until this is possible, and returning the message when it succeeds. TheDC
action will raise the current label todcPublic
; it will raise an exception if this isn't possible. The clearance won't be changed.