protocol-0.1.0.1: Model distributed system as type-level multi-party protocol

Copyright(c) Evgeny Poberezkin
LicenseBSD3
Maintainerevgeny@poberezkin.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Control.Protocol.Example

Description

Example command and protocol definition.

Synopsis

Documentation

type MyProtocol = Protocol MyCommand '[Recipient, Broker, Sender] Source #

Example protocol type.

scenario :: String -> MyProtocol '[None, None, None] '[Ready, Ready, Ready] String Source #

Example protocol scenario.

If you modify this scenario to Send before channel is Created or to Send two messages in a row without forwarding them, the scenario will not compile.

data Party Source #

Constructors

Recipient 
Broker 
Sender 
Instances
Eq Party Source # 
Instance details

Defined in Control.Protocol.Example

Methods

(==) :: Party -> Party -> Bool #

(/=) :: Party -> Party -> Bool #

Show Party Source # 
Instance details

Defined in Control.Protocol.Example

Methods

showsPrec :: Int -> Party -> ShowS #

show :: Party -> String #

showList :: [Party] -> ShowS #

PShow Party Source # 
Instance details

Defined in Control.Protocol.Example

Associated Types

type ShowsPrec arg arg1 arg2 :: Symbol #

type Show_ arg :: Symbol #

type ShowList arg arg1 :: Symbol #

SShow Party Source # 
Instance details

Defined in Control.Protocol.Example

Methods

sShowsPrec :: Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply ShowsPrecSym0 t1) t2) t3) #

sShow_ :: Sing t -> Sing (Apply Show_Sym0 t) #

sShowList :: Sing t1 -> Sing t2 -> Sing (Apply (Apply ShowListSym0 t1) t2) #

SEq Party Source # 
Instance details

Defined in Control.Protocol.Example

Methods

(%==) :: Sing a -> Sing b -> Sing (a == b) #

(%/=) :: Sing a -> Sing b -> Sing (a /= b) #

PEq Party Source # 
Instance details

Defined in Control.Protocol.Example

Associated Types

type x == y :: Bool #

type x /= y :: Bool #

SDecide Party Source # 
Instance details

Defined in Control.Protocol.Example

Methods

(%~) :: Sing a -> Sing b -> Decision (a :~: b) #

SingKind Party Source # 
Instance details

Defined in Control.Protocol.Example

Associated Types

type Demote Party = (r :: Type) #

SingI Recipient Source # 
Instance details

Defined in Control.Protocol.Example

Methods

sing :: Sing Recipient #

SingI Broker Source # 
Instance details

Defined in Control.Protocol.Example

Methods

sing :: Sing Broker #

SingI Sender Source # 
Instance details

Defined in Control.Protocol.Example

Methods

sing :: Sing Sender #

Show (Sing z) Source # 
Instance details

Defined in Control.Protocol.Example

Methods

showsPrec :: Int -> Sing z -> ShowS #

show :: Sing z -> String #

showList :: [Sing z] -> ShowS #

data Sing (a :: Party) Source # 
Instance details

Defined in Control.Protocol.Example

data Sing (a :: Party) where
type Demote Party Source # 
Instance details

Defined in Control.Protocol.Example

type Show_ (arg :: Party) Source # 
Instance details

Defined in Control.Protocol.Example

type Show_ (arg :: Party) = Apply (Show__6989586621680262835Sym0 :: TyFun Party Symbol -> Type) arg
type ShowList (arg :: [Party]) arg1 Source # 
Instance details

Defined in Control.Protocol.Example

type ShowList (arg :: [Party]) arg1 = Apply (Apply (ShowList_6989586621680262846Sym0 :: TyFun [Party] (Symbol ~> Symbol) -> Type) arg) arg1
type (x :: Party) /= (y :: Party) Source # 
Instance details

Defined in Control.Protocol.Example

type (x :: Party) /= (y :: Party) = Not (x == y)
type (a :: Party) == (b :: Party) Source # 
Instance details

Defined in Control.Protocol.Example

type (a :: Party) == (b :: Party)
type ShowsPrec a1 (a2 :: Party) a3 Source # 
Instance details

Defined in Control.Protocol.Example

type ShowsPrec a1 (a2 :: Party) a3

data ChannelState Source #

Example type defining the possible resource states, in this case some communication channel.

Constructors

None 
Ready 
Busy