func NewTupleEntangled(x ...*Var) *Tuple {
	if len(x) > 0 {
		return &Tuple{vars: x[:len(x)-1], entangled: x[len(x)-1]}
	}
	return nil
}
NewTupleEntangled returns a new tuple for the given variables. The last
variable is an optional entangled with the rest.
package types
import "sort"
type Type interface {
	Underlying() Type
	String() string
}
type BasicKind int
const (
	Invalid BasicKind = iota  
	Bool
	Int
	Int8
	Int16
	Int32
	Int64
	Uint
	Uint8
	Uint16
	Uint32
	Uint64
	Uintptr
	Float32
	Float64
	Complex64
	Complex128
	String
	UnsafePointer
	UntypedBool
	UntypedInt
	UntypedRune
	UntypedFloat
	UntypedComplex
	UntypedString
	UntypedNil
	Byte = Uint8
	Rune = Int32
)
type BasicInfo int
const (
	IsBoolean BasicInfo = 1 << iota
	IsInteger
	IsUnsigned
	IsFloat
	IsComplex
	IsString
	IsUntyped
	IsOrdered   = IsInteger | IsFloat | IsString
	IsNumeric   = IsInteger | IsFloat | IsComplex
	IsConstType = IsBoolean | IsNumeric | IsString
)
type Basic struct {
	kind BasicKind
	info BasicInfo
	name string
}
func (b *Basic) Kind() BasicKind { return b.kind }
func (b *Basic) Info() BasicInfo { return b.info }
func (b *Basic) Name() string { return b.name }
type Array struct {
	len  int64
	elem Type
}
func NewArray(elem Type, len int64) *Array { return &Array{len, elem} }
func (a *Array) Len() int64 { return a.len }
func (a *Array) Elem() Type { return a.elem }
type Optional struct {
	elem Type
}
func NewOptional(elem Type) *Optional { return &Optional{elem: elem} }
func (o *Optional) Elem() Type { return o.elem }
type Slice struct {
	elem Type
}
func NewSlice(elem Type) *Slice { return &Slice{elem} }
func (s *Slice) Elem() Type { return s.elem }
type Struct struct {
	fields []*Var
	tags   []string  
}
func NewStruct(fields []*Var, tags []string) *Struct {
	var fset objset
	for _, f := range fields {
		if f.name != "_" && fset.insert(f) != nil {
			panic("multiple fields with the same name")
		}
	}
	if len(tags) > len(fields) {
		panic("more tags than fields")
	}
	return &Struct{fields: fields, tags: tags}
}
func (s *Struct) NumFields() int { return len(s.fields) }
func (s *Struct) Field(i int) *Var { return s.fields[i] }
func (s *Struct) Tag(i int) string {
	if i < len(s.tags) {
		return s.tags[i]
	}
	return ""
}
type Pointer struct {
	base Type  
}
func NewPointer(elem Type) *Pointer { return &Pointer{base: elem} }
func (p *Pointer) Elem() Type { return p.base }
type Tuple struct {
	vars      []*Var
	entangled *Var
}
func NewTuple(x ...*Var) *Tuple {
	if len(x) > 0 {
		return &Tuple{vars: x}
	}
	return nil
}