Module PUBSUB.Sub

include SUBSCRIPTION with type gid := gid and type group := group
type 'a t
type gid
type group
val empty : 'a t

empty returns the empty subscription set.

val add : group -> 'a -> 'a t -> 'a t

add group 'a t adds group to the subscription set t

val remove : gid -> 'a t -> 'a t

remove group t removes group from the subscription set t

val length : 'a t -> int

length t returns the number of groups in the subscription set.

val is_empty : 'a t -> bool

is_empty t returns true if the subscription set is empty.

val mem : gid -> 'a t -> bool

mem gid t returns true if gid is in the subscription set.

val find : gid -> 'a t -> (group * 'a) option

find gid t returns Some group if gid is in the subscription set, otherwise None.

val filter : (gid -> (group * 'a) -> bool) -> 'a t -> 'a t
val fold : (gid -> (group * 'a) -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (gid -> (group * 'a) -> unit) -> 'a t -> unit
val map : (gid -> (group * 'a) -> group * 'a) -> 'a t -> 'a t
val to_list : 'a t -> (group * 'a) list

to_list t returns the subscription set as list ordered by group ID.