| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | mik@konecny.aow.cz |
Control.ERNet.Foundations.Protocol.StandardCombinators
Description
This module defines some basic concrete protocols, namely protocols for transferring a unit and a boolean.
Some protocol combinators are provided to form new protocols from old protocols. Eg one can form a product of two protocols to get a protocol for query-answer dialogues about a pair of values. Similarly, one can construct protocols for a sum of two types, a maybe type and a list type.
Any protocol can be also extended to include effort indices in queries or to allow incremental computation with non-blocking queries on progress, multiple dialogue thread tracking and the communication of a failure.
TODO: add protocols for
- game-theoretic HO functions
Documentation
Constructors
| QAMaybeQ q | |
| QAMaybeQIsNothing q |
Constructors
| QAMaybeA (Maybe a) | |
| QAMaybeAIsNothing Bool |
makeAnswerMaybe :: QAProtocol q a => (q -> Maybe a) -> QAMaybeQ q -> QAMaybeA aSource
Constructors
| QAIxQ EffortIndex q |
Constructors
| QAIxA a |
data QAChangesQ q Source
Constructors
| QAChangesQIfNew QueryId q | |
| QAChangesQWhenNew QueryId q | |
| QAChangesQ q |
Instances
| Typeable1 QAChangesQ | |
| Eq q => Eq (QAChangesQ q) | |
| Ord q => Ord (QAChangesQ q) | |
| Show q => Show (QAChangesQ q) | |
| HTML q => HTML (QAChangesQ q) | |
| (QAProtocol q a, Show q, Show a) => QAProtocol (QAChangesQ q) (QAChangesA a) |
data QAChangesA a Source
Constructors
| QAChangesANew a | |
| QAChangesASame | |
| QAChangesAGivenUp |
Instances
| Typeable1 QAChangesA | |
| Eq a => Eq (QAChangesA a) | |
| Ord a => Ord (QAChangesA a) | |
| Show a => Show (QAChangesA a) | |
| HTML a => HTML (QAChangesA a) | |
| (QAProtocol q a, Show q, Show a) => QAProtocol (QAChangesQ q) (QAChangesA a) |
Constructors
| QAListQAllHomog q | |
| QAListQSingle Int q | |
| QAListQPrefix [q] | |
| QAListQLength |
Constructors
| QAListA [a] | |
| QAListASingle a | |
| QAListALength Int |
makeAnswerList :: QAProtocol q a => [a] -> QAListQ q -> QAListA aSource
Constructors
| QAProdQFirst q1 | |
| QAProdQSecond q2 | |
| QAProdQBoth q1 q2 |
Instances
Constructors
| QAProdAFirst a1 | |
| QAProdASecond a2 | |
| QAProdABoth a1 a2 |
Instances
chTProd :: ChannelType -> ChannelType -> ChannelTypeSource
makeAnswerProd :: (QAProtocol q1 a1, QAProtocol q2 a2) => (q1 -> a1) -> (q2 -> a2) -> QAProdQ q1 q2 -> QAProdA a1 a2Source