AERN-Net-0.2.1.1: Compositional lazy dataflow networks for exact real number computation

Portabilityportable
Stabilityexperimental
Maintainermik@konecny.aow.cz

Control.ERNet.Foundations.Protocol

Description

This module defines the concept of a protocol for channel communication.

The protocol concept is formalised using the 2-parameter class QAProtocol and the existential types ChannelType, AnswerAnyProt, QueryAnyProt indexed by instances of QAProtocol.

Synopsis

Documentation

type QueryId = IntSource

any danger of over 2^29 queries?

class (Ord q, HTML q, HTML a, Show q, Show a, Typeable q, Typeable a) => QAProtocol q a | a -> q, q -> a whereSource

A class grouping types of queries and answers.

Each instance has to define dynamic type checking of answers agains queries.

Methods

qaMatchSource

Arguments

:: q 
-> a 
-> Maybe String

error message

test whether the answer makes sense for a given query (dynamic type checking)

qaaSetMinGran :: Granularity -> a -> aSource

Instances

QAProtocol QANatQ QANatA 
QAProtocol QABoolQ Bool 
QAProtocol QAUnitQ QAUnitA 
QAProtocol QALFTRealQ QALFTRealA 
(ERApproxElementary ira, Typeable ira) => QAProtocol QARealQ (QARealA ira) 
(QAProtocol q a, Show q, Show a) => QAProtocol (QAListQ q) (QAListA a) 
(QAProtocol q a, Show q, Show a) => QAProtocol (QAChangesQ q) (QAChangesA a) 
QAProtocol q a => QAProtocol (QAIxQ q) (QAIxA a) 
(QAProtocol q a, Show q, Show a) => QAProtocol (QAMaybeQ q) (QAMaybeA a) 
(ERFnApprox box varid domra ranra fa, Typeable fa, HTML fa) => QAProtocol (QAFn2Q fa) (QAFn2A fa) 
(ERFnApprox box varid domra ranra fa, ERApproxElementary domra, ERApproxElementary ranra, Typeable box, Show box, Typeable domra, Typeable ranra, Typeable fa, HTML fa) => QAProtocol (QAFn1Q box) (QAFn1A ranra fa) 
(QAProtocol q1 a1, QAProtocol q2 a2, Show q1, Show a1, Show q2, Show a2) => QAProtocol (QAProdQ q1 q2) (QAProdA a1 a2) 

data ChannelType Source

This type is used to identify protocols eg for the creation of new channels or for dynamic type checking. It consists of an example query and an example answer.

Constructors

forall q a . (QAProtocol q a, Eq q, Show q, Eq a, Show a) => ChannelType q a 

data QueryAnyProt Source

Union of queries from all protocols.

Constructors

forall q a . (QAProtocol q a, Show q, Show a) => QueryAnyProt q 

data AnswerAnyProt Source

Union of answers from all protocols.

Constructors

forall q a . (QAProtocol q a, Show q, Show a) => AnswerAnyProt a