Documentation ¶
Overview ¶
Package types declares the types and implements the algorithms for type inference for programs written using the asyncpi package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base represents a base (concrete) type. Base types are 'abstract' type only known by their name.
func (*Base) Underlying ¶
Underlying returns itself as the underlying type of b.
type Chan ¶
type Chan struct {
// contains filtered or unexported fields
}
Chan represents a channel type.
func (*Chan) Underlying ¶
Underlying returns itself as the underlying type of c.
type Composite ¶
type Composite struct {
// contains filtered or unexported fields
}
Composite represents a composite type of multiple types. The type is mainly used for representing polyadic parameters of a channel.
func NewComposite ¶
NewComposite returns a new Composite type for the given types.
func (*Composite) Underlying ¶
Underlying returns itself as the underlying type of c.
type InferUntypedError ¶
type InferUntypedError struct {
Name string
}
InferUnTypedError is the type of error when type inference is applied on an untyped Process.
func (InferUntypedError) Error ¶
func (e InferUntypedError) Error() string
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
Reference is a reference to the type of a given Name.
func NewReference ¶
NewReference returns a new Name reference to the given Name.
func (*Reference) Underlying ¶
Underlying returns the type of the referenced Name as the underlying type of r.
type Type ¶
type Type interface { // Underlying returns the underlying type of a type. Underlying() Type // String returns a string representation of a type. String() string }
A Type represents a type in asyncpi. All types implement the Type interface.
type TypeArityError ¶
TypeArityError is the type of error when process parameter arity does not match when unifying.
func (TypeArityError) Error ¶
func (e TypeArityError) Error() string
type TypeError ¶
TypeError is the type of error when analysing the behavioural type of an asyncpi Process.
type TypedName ¶
type TypedName interface { // Name is the wrapped Name. asyncpi.Name // Type returns the type of the wrapped Name. Type() Type // contains filtered or unexported methods }
TypedName is a typed wrapper for Name. A TypedName can be used as a Name.
func AttachType ¶
AttachType wraps the given n with types. The default type is unconstrained.
Notes ¶
Bugs ¶
Inference may fail if type of a name is recursively defined (e.g. a<a> → typed chan of type(a)), printing the type will cause a stack overflow.