refinement

package
v0.0.0-...-60d02c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAliasWithBaseType

func ParseAliasWithBaseType(s string, baseType types.Type) (identName string, resultType types.Type, err error)

func ParseWithBaseType

func ParseWithBaseType(s string, baseType types.Type) (identName string, resultType types.Type, err error)

Types

type DependentSignature

type DependentSignature struct {
	*types.Signature
	ParamRefinements   *RefinedTuple
	ResultsRefinements *RefinedTuple
}

func NewDependentSignature

func NewDependentSignature(sig *types.Signature, params, results *RefinedTuple) *DependentSignature

func (*DependentSignature) String

func (s *DependentSignature) String() string

func (*DependentSignature) Underlying

func (s *DependentSignature) Underlying() types.Type

type RefinedTuple

type RefinedTuple struct {
	// contains filtered or unexported fields
}

func NewRefinedTuple

func NewRefinedTuple(x ...*RefinedVar) *RefinedTuple

func (*RefinedTuple) At

func (t *RefinedTuple) At(i int) *RefinedVar

func (*RefinedTuple) Len

func (t *RefinedTuple) Len() int

func (*RefinedTuple) String

func (t *RefinedTuple) String() string

func (*RefinedTuple) Underlying

func (t *RefinedTuple) Underlying() types.Type

type RefinedType

type RefinedType struct {
	*Refinement
	types.Type
	// contains filtered or unexported fields
}

func NewRefinedTypeFromValue

func NewRefinedTypeFromValue(v constant.Value) (*RefinedType, error)

NewRefinedTypeFromValue returns narrowest type of given value.

func NewRefinedTypeWithTruePredicate

func NewRefinedTypeWithTruePredicate(typ types.Type) *RefinedType

func (*RefinedType) ConstantNode

func (r *RefinedType) ConstantNode() ast.Expr

func (*RefinedType) IsConstant

func (r *RefinedType) IsConstant() bool

func (*RefinedType) String

func (r *RefinedType) String() string

func (*RefinedType) Underlying

func (r *RefinedType) Underlying() types.Type

type RefinedVar

type RefinedVar struct {
	// TODO
	Name        string
	RefinedType *RefinedType
}

type Refinement

type Refinement struct {
	Predicate ast.Expr
	RefVar    *ast.Ident
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL