free-agent-0.1.0: Multi agent systems based on free monads.

Portabilityghc
Stabilityexperimental
Maintainernickolay.kudasov@gmail.com
Safe HaskellSafe-Inferred

Control.Agent.Free.Interfaces.SendRecv

Contents

Description

A simple send/receive interface.

Synopsis

Interface

data SendRecv i msg next

Abstract interface for send/receive communication. i represents sender/receiver ID and msg is a type of messages.

Constructors

Send i msg next

Send a message. See also send.

Recv (i -> msg -> next)

Receive a message. See also recv.

Instances

Functor (SendRecv i msg) 

send :: MonadFree (SendRecv i msg) m => i -> msg -> m ()

Send a Message.

recv :: MonadFree (SendRecv i msg) m => m (i, msg)

Receive a Message.