Documentation ¶
Index ¶
- Constants
- type Argument
- type BasicKind
- type Kind
- type MonoType
- func (mt *MonoType) Argument(i int) (*Argument, error)
- func (mt *MonoType) Basic() (BasicKind, error)
- func (mt *MonoType) ElemType() (*MonoType, error)
- func (mt *MonoType) Extends() (*MonoType, error)
- func (mt *MonoType) Kind() Kind
- func (mt *MonoType) NumArguments() (int, error)
- func (mt *MonoType) NumProperties() (int, error)
- func (mt *MonoType) Property(i int) (*Property, error)
- func (mt *MonoType) ReturnType() (*MonoType, error)
- func (mt *MonoType) String() string
- func (mt *MonoType) VarNum() (uint64, error)
- type PolyType
- type Property
Constants ¶
const ( Unknown = Kind(fbsemantic.MonoTypeNONE) Basic = Kind(fbsemantic.MonoTypeBasic) Var = Kind(fbsemantic.MonoTypeVar) Arr = Kind(fbsemantic.MonoTypeArr) Row = Kind(fbsemantic.MonoTypeRow) Fun = Kind(fbsemantic.MonoTypeFun) )
const ( Bool = BasicKind(fbsemantic.TypeBool) Int = BasicKind(fbsemantic.TypeInt) Uint = BasicKind(fbsemantic.TypeUint) Float = BasicKind(fbsemantic.TypeFloat) String = BasicKind(fbsemantic.TypeString) Duration = BasicKind(fbsemantic.TypeDuration) Time = BasicKind(fbsemantic.TypeTime) Regexp = BasicKind(fbsemantic.TypeRegexp) Bytes = BasicKind(fbsemantic.TypeBytes) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument struct {
*fbsemantic.Argument
}
Argument represents a function argument.
type MonoType ¶
type MonoType struct {
// contains filtered or unexported fields
}
MonoType represents a monotype. This struct is a thin wrapper around Go code generated by the FlatBuffers compiler.
func NewMonoType ¶
func NewMonoType(tbl *flatbuffers.Table, t fbsemantic.MonoType) (*MonoType, error)
NewMonoType constructs a new monotype from a FlatBuffers table and the given kind of monotype.
func (*MonoType) Argument ¶
Argument returns the argument give an ordinal position if this monotype is a function, and an error otherwise.
func (*MonoType) Basic ¶
Basic returns the basic type for this monotype if it is a basic type, and an error otherwise.
func (*MonoType) ElemType ¶
ElemType returns the element type if this monotype is an array, and an error otherise.
func (*MonoType) Extends ¶
Extends returns the extending type variable if this monotype is a row, and an error otherwise.
func (*MonoType) NumArguments ¶
NumArguments returns the number of arguments if this monotype is a function, and an error otherwise.
func (*MonoType) NumProperties ¶
NumProperties returns the number of properties if this monotype is a row, and an error otherwise.
func (*MonoType) Property ¶
Property returns a property given its ordinal position if this monotype is a row, and an error otherwise.
func (*MonoType) ReturnType ¶
type PolyType ¶
type PolyType struct {
// contains filtered or unexported fields
}
PolyType represents a polytype. This struct is a thin wrapper around Go code generated by the FlatBuffers compiler.
func NewPolyType ¶
func NewPolyType(fb *fbsemantic.PolyType) (*PolyType, error)
NewPolyType returns a new polytype given a flatbuffers polytype.
func (*PolyType) Constraint ¶
func (pt *PolyType) Constraint(i int) (*fbsemantic.Constraint, error)
Constraint returns the constraint at ordinal position i.
func (*PolyType) NumConstraints ¶
NumConstraints returns the number of kind constraints in this polytype.