epistemic-group-gossip-0.1.0.0
Copyright(c) Jesper Kuiper 2021
Leander van Boven 2021
Ramon Meffert 2021
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

GossipTypes

Description

 
Synopsis

Type definitions

Agents

type Agent = LNode Char Source #

The type of an agent. Agents are always defined in terms of a character and a corresponding (unique) identifying integer.

type AgentId = Int Source #

The agent identifier.

type AgentName = Char Source #

The agent name.

Calls

type Call = (Agent, Agent) Source #

A call between two agents, defined as (fromcaller, tocallee). A call is considered to be bidirectional, i.e. information flows from the caller to the callee and vice versa.

type GroupCall = (Agent, [Agent]) Source #

A call between a group of agents. The first item in the tuple is the caller, they need to have the phone number of all callees in the list. A group call is also omnidirectional, i.e. the all agent information is pooled and distributed to all agents in the call.

Call generation

(☎) :: Agent -> Agent -> Call infix 0 Source #

Generates a call between two agents.

toCalls :: GroupCall -> [Call] Source #

Converts a group call to a list of direct calls. This results in an identical flow of information.

Showables and printables

Agents

showAgent :: Agent -> String Source #

Converts an agent to a print-friendly string.

Calls

printCall :: Call -> IO () Source #

Prints a call.

printCalls :: [Call] -> IO () Source #

Prints a list of calls.

printMakeCall :: Call -> IO () Source #

Prints a message that a call is made between two agents.

Group calls

printGroupCall :: GroupCall -> IO () Source #

Prints a group call.

printGroupCalls :: [GroupCall] -> IO () Source #

Prints a list of group calls.

printMakeGroupCall :: GroupCall -> IO () Source #

Prints a message that a group call is made.

General

printNoCalls :: IO () Source #

Prints a message that no calls are available.

printAllCalls :: ([Call], [GroupCall]) -> IO () Source #

Prints all calls, given a list of direct calls and group calls.