A ComplementedPort P
is a Port
s.t. whenever it is BinaryOperable
with another Port
P2, P2
is a particular type - either P's
complement type, or a KeyedPort
that delegates to P's
complement type in a binary operation with P.
ComplementedPorts
are useful in situations where Port
types are BinaryOperable
in a one-to-one fashion (a pair of Port
types are each other's port complements), or in a one-to-many fashion
(a number of Port
types have the same complement port). An example of the latter is Dataflow.Signals, where any signal of signature T
has a complement port of type function<T>, and can therefore model ComplementedPort,
but function<T>
cannot because there are many signal
types to which it can be connected.
The traits of a ComplementedPort
are captured by the ComplementedPortTraits,
which refines the PortTraits
with an additional member type specifying the complement port type.
ComplementedPort Refines
ComplementedPortTraits Refines
Notation
The following expressions are used in this document:
-
T -
A
Tagtype. If omitted,Tdefaults todefault_tag. -
P -
A
ComplementedPorttype, forTagT. -
PT -
ComplementedPortTraitsofPforT.
ComplementedPort Requirements
|
Name |
Expression |
Result Type |
Semantics |
|---|---|---|---|
|
Port Traits |
|
|
The |
ComplementedPortTraits Requirements
|
Name |
Expression |
Result Type |
Semantics |
|---|---|---|---|
|
Complement Port Type |
|
Any |
The complement port type of |