module Bare:sig..end
val create : ?name:string -> unit -> ('a, 'b) Session.st * ('b, 'a) Session.stcreate () creates a new session.
val close : Session.et -> unitclose ep closes endpoint ep.
InvalidEndpoint if the
endpoint ep is invalid.val send : 'm -> ('m * ('a, 'b) Session.st) Session.ot -> ('b, 'a) Session.stsend e ep sends e on the endpoint ep with output
capability.
InvalidEndpoint if
ep is invalid.ep.val receive : ('m * ('a, 'b) Session.st) Session.it -> 'm * ('a, 'b) Session.streceive ep receives a message from the endpoint ep with
input capability.
InvalidEndpoint if the endpoint
ep is invalid.(v, ep) with the received message
v and the endpoint ep.val select : (('a, 'b) Session.st -> 'm) -> 'm Session.ot -> ('b, 'a) Session.stselect f ep sends f to the peer endpoint of ep, where it
is used to compute the received message.
InvalidEndpoint if the endpoint ep is invalid.ep.val select_true : [> `True of ('a, 'b) Session.st ] Session.ot -> ('b, 'a) Session.stselect_true ep selects the True branch of a choice.
InvalidEndpoint if the
endpoint ep is invalid.ep after the selection.val select_false : [> `False of ('a, 'b) Session.st ] Session.ot -> ('b, 'a) Session.stselect_false ep selects the False branch of a choice.
InvalidEndpoint if the endpoint ep is invalid.ep after the selection.val branch : ([> ] as 'm) Session.it -> 'mbranch ep receives a selection from the endpoint ep with
input capability.
InvalidEndpoint if the endpoint ep is
invalid.ep injected through the
selected tag.val is_valid : ('a, 'b) Session.st -> boolis_valid ep determines whether ep is a valid endpoint or not.
true if ep is valid, false otherwise.val acquire : ('a, 'b) Session.st -> ('a, 'b) Session.stacquire ep acquires the endpoint ep, if it is valid.
InvalidEndpoint if ep invalid.ep.val try_acquire : ('a, 'b) Session.st -> ('a, 'b) Session.st optiontry_acquire ep attempts to acquire the endpoint ep.
Some ep where ep is the unique valid reference to the endpoint,
if ep is valid, and None otherwise.val same_session : ('a, 'b) Session.st -> ('c, 'd) Session.st -> boolsame_session ep ep' checks whether ep and ep' are endpoints
of the same session (but not necessarily peer endpoints).
true if ep and ep' are (possibly peer) endpoints pertaining the
same session, false otherwise.val string_of_endpoint : ('a, 'b) Session.st -> stringstring_of_endpoint ep returns a textual representation of the
endpoint ep.
val (@=) : (('a, 'b) Session.st -> 'm * Session.et) ->
((('a, 'b) Session.st, ('c, 'd) Session.st) Session.seq,
(('b, 'a) Session.st, ('d, 'c) Session.st) Session.seq)
Session.st -> 'm * ('c, 'd) Session.stf @= ep evaluates f ep.
InvalidEndpoint if the second component of f ep
is an endpoint other than ep.f ep
evaluates.val (@>) : (('a, 'b) Session.st -> Session.et) ->
((('a, 'b) Session.st, ('c, 'd) Session.st) Session.seq,
(('b, 'a) Session.st, ('d, 'c) Session.st) Session.seq)
Session.st -> ('c, 'd) Session.stf @> ep evaluates f ep.
InvalidEndpoint if f ep evaluates to an endpoint different from
ep.ep.