symbol

package
v0.0.0-...-dc6f9f8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BasicTrue  = BasicSymbol{true}
	BasicFalse = BasicSymbol{false}
)
View Source
var EmptySeries = &SeriesSymbol{
	Type_: &SeriesType{Elem: EmptyType{}},
}

Functions

func AsBasicBool

func AsBasicBool(sym Symbol) (value bool, ok bool)

func AsBasicString

func AsBasicString(sym Symbol) (value string, ok bool)

func AsBool

func AsBool(sym Symbol) bool

func EncodeSymbol

func EncodeSymbol(span *model.Span, symbol Symbol) ([]byte, error)

func FieldSymbolsEqual

func FieldSymbolsEqual(span *model.Span, x, y FieldSymbols) bool

func FieldSymbolsHash

func FieldSymbolsHash(span *model.Span, fields FieldSymbols) model.ID

func FilterEmptyEvalFields

func FilterEmptyEvalFields(group []eval.Field) (filtered []eval.Field)

func FilterUnderscoreFields

func FilterUnderscoreFields(fields []eval.Field) (filtered []eval.Field)

FilterUnderscoreFields filters out all fields whose name begins with underscore.

func Integrate

func Integrate(span *model.Span, s Symbol, t reflect.Type) (reflect.Value, error)

Integrate a Ko value into a Go value of given type.

func IntegrateInterface

func IntegrateInterface(span *model.Span, s Symbol, t reflect.Type) (interface{}, error)

IntegrateInterface integrates a Ko value into a Go value of given type, returning the Go value as interface{}.

func IsBasicKind

func IsBasicKind(s Symbol, kind reflect.Kind) bool

func IsEmptySymbol

func IsEmptySymbol(sym Symbol) bool

func IsEmptyType

func IsEmptyType(t Type) bool

func IsSignedIntegerType

func IsSignedIntegerType(t Type) bool

func IsUnsignedIntegerType

func IsUnsignedIntegerType(t Type) bool

func IsVarietySymbol

func IsVarietySymbol(sym Symbol) bool

func SignedMaximal

func SignedMaximal(sym Symbol) int64

func UnsignedMaximal

func UnsignedMaximal(sym Symbol) uint64

func VerifyNoDuplicateFieldSymbol

func VerifyNoDuplicateFieldSymbol(span *model.Span, fieldSymbols FieldSymbols) error

Types

type BasicSymbol

type BasicSymbol struct {
	Value interface{} `ko:"name=value"`
}

func MakeBasicSymbol

func MakeBasicSymbol(span *model.Span, v interface{}) BasicSymbol

func (BasicSymbol) Augment

func (basic BasicSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (BasicSymbol) ConvertTo

func (basic BasicSymbol) ConvertTo(span *model.Span, to BasicType) (BasicSymbol, error)

func (BasicSymbol) DisassembleToGo

func (basic BasicSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (BasicSymbol) DisassembleToPB

func (basic BasicSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (BasicSymbol) Equal

func (basic BasicSymbol) Equal(span *model.Span, sym Symbol) bool

func (BasicSymbol) GoValue

func (basic BasicSymbol) GoValue() reflect.Value

func (BasicSymbol) Hash

func (basic BasicSymbol) Hash(span *model.Span) model.ID

func (BasicSymbol) Invoke

func (basic BasicSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (BasicSymbol) LiftToSeries

func (basic BasicSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (basic BasicSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (BasicSymbol) Select

func (basic BasicSymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (BasicSymbol) Splay

func (basic BasicSymbol) Splay() tree.Tree

func (BasicSymbol) String

func (basic BasicSymbol) String() string

func (BasicSymbol) Type

func (basic BasicSymbol) Type() Type

type BasicType

type BasicType int

BasicType is the type for basic values such as strings, bools and numbers

const (
	BasicInvalid BasicType = iota
	BasicBool
	BasicString
	BasicInt8
	BasicInt16
	BasicInt32
	BasicInt64
	BasicUint8
	BasicUint16
	BasicUint32
	BasicUint64
	BasicFloat32
	BasicFloat64
)

func BasicFromKind

func BasicFromKind(kind reflect.Kind) BasicType

func (BasicType) GoType

func (basic BasicType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (BasicType) IsType

func (BasicType) IsType()

func (BasicType) Kind

func (b BasicType) Kind() reflect.Kind

func (BasicType) Splay

func (basic BasicType) Splay() tree.Tree

func (BasicType) String

func (basic BasicType) String() string

type BlobSymbol

type BlobSymbol struct {
	Value reflect.Value `ko:"name=value"` // []byte
}

func MakeBlobSymbol

func MakeBlobSymbol(b []byte) *BlobSymbol

func (*BlobSymbol) Augment

func (blob *BlobSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (*BlobSymbol) Bytes

func (blob *BlobSymbol) Bytes() []byte

func (*BlobSymbol) DisassembleToGo

func (blob *BlobSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*BlobSymbol) DisassembleToPB

func (blob *BlobSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*BlobSymbol) Equal

func (blob *BlobSymbol) Equal(span *model.Span, sym Symbol) bool

func (*BlobSymbol) Hash

func (blob *BlobSymbol) Hash(span *model.Span) model.ID

func (*BlobSymbol) Invoke

func (blob *BlobSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*BlobSymbol) LiftToSeries

func (blob *BlobSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (blob *BlobSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*BlobSymbol) Select

func (blob *BlobSymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (*BlobSymbol) Splay

func (blob *BlobSymbol) Splay() tree.Tree

func (*BlobSymbol) String

func (blob *BlobSymbol) String() string

func (*BlobSymbol) Type

func (blob *BlobSymbol) Type() Type

type BlobType

type BlobType struct{}

BlobType captures the []byte type.

func (BlobType) GoType

func (BlobType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (BlobType) IsType

func (blob BlobType) IsType()

func (BlobType) Splay

func (blob BlobType) Splay() tree.Tree

func (BlobType) String

func (blob BlobType) String() string

type EmptySymbol

type EmptySymbol struct{}

func (EmptySymbol) Augment

func (empty EmptySymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (EmptySymbol) DisassembleToGo

func (empty EmptySymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (EmptySymbol) DisassembleToPB

func (empty EmptySymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (EmptySymbol) Equal

func (empty EmptySymbol) Equal(span *model.Span, sym Symbol) bool

func (EmptySymbol) Hash

func (empty EmptySymbol) Hash(span *model.Span) model.ID

func (EmptySymbol) Invoke

func (empty EmptySymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (EmptySymbol) LiftToSeries

func (empty EmptySymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (empty EmptySymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (EmptySymbol) Select

func (empty EmptySymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (EmptySymbol) Splay

func (empty EmptySymbol) Splay() tree.Tree

func (EmptySymbol) String

func (empty EmptySymbol) String() string

func (EmptySymbol) Type

func (empty EmptySymbol) Type() Type

type EmptyType

type EmptyType struct{}

func (EmptyType) GoType

func (EmptyType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (EmptyType) IsType

func (EmptyType) IsType()

func (EmptyType) Splay

func (EmptyType) Splay() tree.Tree

func (EmptyType) String

func (EmptyType) String() string

type EvokeArg

type EvokeArg struct {
	Name  string `ko:"name=name"`
	Value Symbol `ko:"name=value"`
}

type FieldSymbol

type FieldSymbol struct {
	Name    string `ko:"name=name"`
	Monadic bool   `ko:"name=monadic"`
	Value   Symbol `ko:"name=value"`
}

func FindIntegrationField

func FindIntegrationField(from *StructSymbol, to reflect.StructField) *FieldSymbol

type FieldSymbols

type FieldSymbols []*FieldSymbol

func FilterEmptyFieldSymbols

func FilterEmptyFieldSymbols(fields FieldSymbols) (filtered FieldSymbols)

func GroupFieldsToSymbols

func GroupFieldsToSymbols(span *model.Span, fields eval.Fields) (FieldSymbols, error)

func (FieldSymbols) Copy

func (fs FieldSymbols) Copy() FieldSymbols

func (FieldSymbols) Len

func (fs FieldSymbols) Len() int

func (FieldSymbols) Less

func (fs FieldSymbols) Less(i, j int) bool

func (FieldSymbols) Sort

func (fs FieldSymbols) Sort()

func (FieldSymbols) Swap

func (fs FieldSymbols) Swap(i, j int)

type FieldType

type FieldType struct {
	Name  string `ko:"name=name"`
	Type_ Type   `ko:"name=type"`
}

func FieldSymbolTypes

func FieldSymbolTypes(fields FieldSymbols) []*FieldType

type InterpretMacro

type InterpretMacro interface {
	InterpretFunc() (pkgPath, funcName string)
}

type KeyValueSymbol

type KeyValueSymbol struct {
	Key   string `ko:"name=key"`
	Value Symbol `ko:"name=value"`
}

type MapSymbol

type MapSymbol struct {
	Type_ *MapType          `ko:"name=type"`
	Map   map[string]Symbol `ko:"name=map"`
}

MapSymbol captures map[string]Q types.

func (*MapSymbol) Augment

func (ms *MapSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (*MapSymbol) DisassembleToGo

func (ms *MapSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*MapSymbol) DisassembleToPB

func (ms *MapSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*MapSymbol) Equal

func (ms *MapSymbol) Equal(span *model.Span, sym Symbol) bool

func (*MapSymbol) Hash

func (ms *MapSymbol) Hash(span *model.Span) model.ID

func (*MapSymbol) Invoke

func (ms *MapSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*MapSymbol) LiftToSeries

func (ms *MapSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (ms *MapSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*MapSymbol) Select

func (ms *MapSymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (*MapSymbol) SortedKeys

func (ms *MapSymbol) SortedKeys() []string

func (*MapSymbol) Splay

func (ms *MapSymbol) Splay() tree.Tree

func (*MapSymbol) String

func (ms *MapSymbol) String() string

func (*MapSymbol) Type

func (ms *MapSymbol) Type() Type

type MapType

type MapType struct {
	Value Type `ko:"name=type"`
}

MapType is the type capturing map[string]T

func (*MapType) GoType

func (mt *MapType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (*MapType) IsType

func (mt *MapType) IsType()

func (*MapType) Splay

func (mt *MapType) Splay() tree.Tree

func (*MapType) String

func (mt *MapType) String() string

type NamedSymbol

type NamedSymbol struct {
	Value reflect.Value `ko:"name=value"`
}

func (*NamedSymbol) Augment

func (named *NamedSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (*NamedSymbol) DisassembleToGo

func (named *NamedSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*NamedSymbol) DisassembleToPB

func (named *NamedSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*NamedSymbol) Equal

func (named *NamedSymbol) Equal(span *model.Span, sym Symbol) bool

func (*NamedSymbol) GoType

func (named *NamedSymbol) GoType() reflect.Type

func (*NamedSymbol) Hash

func (named *NamedSymbol) Hash(span *model.Span) model.ID

func (*NamedSymbol) Invoke

func (named *NamedSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*NamedSymbol) LiftToSeries

func (named *NamedSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (named *NamedSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*NamedSymbol) Select

func (named *NamedSymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (*NamedSymbol) Splay

func (named *NamedSymbol) Splay() tree.Tree

func (*NamedSymbol) String

func (named *NamedSymbol) String() string

func (*NamedSymbol) Type

func (named *NamedSymbol) Type() Type

func (*NamedSymbol) Walk

func (named *NamedSymbol) Walk(span *model.Span, field string) (Symbol, error)

type NamedType

type NamedType struct {
	Type reflect.Type `ko:"name=type"`
}

func (NamedType) GoType

func (nt NamedType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (NamedType) IsType

func (nt NamedType) IsType()

func (NamedType) Splay

func (nt NamedType) Splay() tree.Tree

func (NamedType) String

func (nt NamedType) String() string

type OpaqueSymbol

type OpaqueSymbol struct {
	Value reflect.Value `ko:"name=value"`
}

func (*OpaqueSymbol) Augment

func (opaque *OpaqueSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (*OpaqueSymbol) DisassembleToGo

func (opaque *OpaqueSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*OpaqueSymbol) DisassembleToPB

func (opaque *OpaqueSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*OpaqueSymbol) Equal

func (opaque *OpaqueSymbol) Equal(span *model.Span, sym Symbol) bool

func (*OpaqueSymbol) GoType

func (opaque *OpaqueSymbol) GoType() reflect.Type

func (*OpaqueSymbol) Hash

func (opaque *OpaqueSymbol) Hash(span *model.Span) model.ID

func (*OpaqueSymbol) Interface

func (opaque *OpaqueSymbol) Interface() interface{}

func (*OpaqueSymbol) Invoke

func (opaque *OpaqueSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*OpaqueSymbol) LiftToSeries

func (opaque *OpaqueSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (opaque *OpaqueSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*OpaqueSymbol) Select

func (opaque *OpaqueSymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (*OpaqueSymbol) Splay

func (opaque *OpaqueSymbol) Splay() tree.Tree

func (*OpaqueSymbol) String

func (opaque *OpaqueSymbol) String() string

func (*OpaqueSymbol) Type

func (opaque *OpaqueSymbol) Type() Type

type OpaqueType

type OpaqueType struct {
	Type reflect.Type `ko:"name=type"`
}

OpaqueType captures a specific Go type.

func (*OpaqueType) GoType

func (ot *OpaqueType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (*OpaqueType) IsType

func (ot *OpaqueType) IsType()

func (*OpaqueType) Splay

func (ot *OpaqueType) Splay() tree.Tree

func (*OpaqueType) String

func (ot *OpaqueType) String() string

type OptionalType

type OptionalType struct {
	Elem Type `ko:"name=elem"`
}

func (*OptionalType) GoType

func (ot *OptionalType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (*OptionalType) IsType

func (*OptionalType) IsType()

func (*OptionalType) Splay

func (ot *OptionalType) Splay() tree.Tree

func (*OptionalType) String

func (ot *OptionalType) String() string

type SeriesSymbol

type SeriesSymbol struct {
	Type_ *SeriesType `ko:"name=type"`
	Elem  Symbols     `ko:"name=elem"`
}

func (*SeriesSymbol) Augment

func (ss *SeriesSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (*SeriesSymbol) DisassembleToGo

func (ss *SeriesSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*SeriesSymbol) DisassembleToPB

func (ss *SeriesSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*SeriesSymbol) Equal

func (ss *SeriesSymbol) Equal(span *model.Span, sym Symbol) bool

func (*SeriesSymbol) Hash

func (ss *SeriesSymbol) Hash(span *model.Span) model.ID

func (*SeriesSymbol) Invoke

func (ss *SeriesSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*SeriesSymbol) IsEmpty

func (ss *SeriesSymbol) IsEmpty() bool

func (*SeriesSymbol) Len

func (ss *SeriesSymbol) Len() int

func (*SeriesSymbol) LiftToSeries

func (ss *SeriesSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (ss *SeriesSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*SeriesSymbol) Select

func (ss *SeriesSymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (*SeriesSymbol) Splay

func (ss *SeriesSymbol) Splay() tree.Tree

func (*SeriesSymbol) String

func (ss *SeriesSymbol) String() string

func (*SeriesSymbol) Type

func (ss *SeriesSymbol) Type() Type

type SeriesType

type SeriesType struct {
	Elem Type `ko:"name=elem"`
}

func (*SeriesType) GoType

func (st *SeriesType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (*SeriesType) IsType

func (*SeriesType) IsType()

func (*SeriesType) Splay

func (st *SeriesType) Splay() tree.Tree

func (*SeriesType) String

func (st *SeriesType) String() string

type StructSymbol

type StructSymbol struct {
	Type_ *StructType  `ko:"name=type"`
	Field FieldSymbols `ko:"name=field"`
}

func DecodeArg

func DecodeArg(span *model.Span, asm VarietyAssembler, argBytes []byte) (*StructSymbol, error)

func FilterEmptyStructFields

func FilterEmptyStructFields(ss *StructSymbol) *StructSymbol

func MakeStructSymbol

func MakeStructSymbol(fields FieldSymbols) *StructSymbol

func (*StructSymbol) Augment

func (ss *StructSymbol) Augment(span *model.Span, _ eval.Fields) (eval.Shape, eval.Effect, error)

func (*StructSymbol) DisassembleToGo

func (ss *StructSymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*StructSymbol) DisassembleToPB

func (ss *StructSymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*StructSymbol) Equal

func (ss *StructSymbol) Equal(span *model.Span, sym Symbol) bool

func (*StructSymbol) FindMonadic

func (ss *StructSymbol) FindMonadic() *FieldSymbol

func (*StructSymbol) FindName

func (ss *StructSymbol) FindName(name string) *FieldSymbol

func (*StructSymbol) GetMonadic

func (ss *StructSymbol) GetMonadic() (Symbol, bool)

func (*StructSymbol) Hash

func (ss *StructSymbol) Hash(span *model.Span) model.ID

func (*StructSymbol) Invoke

func (ss *StructSymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*StructSymbol) IsEmpty

func (ss *StructSymbol) IsEmpty() bool

func (*StructSymbol) LiftToSeries

func (ss *StructSymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (ss *StructSymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*StructSymbol) LinkField

func (ss *StructSymbol) LinkField(name string, monadic bool) Symbol

func (*StructSymbol) Select

func (ss *StructSymbol) Select(span *model.Span, path model.Path) (_ eval.Shape, _ eval.Effect, err error)

func (*StructSymbol) Splay

func (ss *StructSymbol) Splay() tree.Tree

func (*StructSymbol) String

func (ss *StructSymbol) String() string

func (*StructSymbol) Type

func (ss *StructSymbol) Type() Type

func (*StructSymbol) Walk

func (ss *StructSymbol) Walk(step string) Symbol

type StructType

type StructType struct {
	Field []*FieldType `ko:"name=field"`
}

func (*StructType) GoType

func (st *StructType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (*StructType) GoTypeAndNameMap

func (st *StructType) GoTypeAndNameMap() (reflect.Type, map[string]string)

GoTypeAndNameMap returns the Go equivalent of the type and a map from Ko (field) name to Go (field) name

func (*StructType) IsType

func (*StructType) IsType()

func (*StructType) Splay

func (st *StructType) Splay() tree.Tree

func (*StructType) String

func (st *StructType) String() string

type Symbol

type Symbol interface {
	eval.Shape   // String, Select, Augment, Invoke, Link
	tree.Splayer // Splay
	Type() Type
	Hash(*model.Span) model.ID
	Equal(*model.Span, Symbol) bool
	LiftToSeries(*model.Span) *SeriesSymbol
	// DisassembleToGo converts a Ko value into a Go value
	DisassembleToGo(*model.Span) (reflect.Value, error)
	// DisassembleToPB converts a Ko value into a protobuf
	DisassembleToPB(*model.Span) (*pb.Symbol, error)
}

Symbol implementations:

BasicSymbol, EmptySymbol,

*SeriesSymbol, *StructSymbol *NamedSymbol, *OpaqueSymbol, *MapSymbol *VarietySymbol, *BlobSymbol

func Assemble

func Assemble(span *model.Span, asm VarietyAssembler, pbSymbol *pb.Symbol) Symbol

Assemble panics on invalid protocol structure.

func AssembleWithError

func AssembleWithError(span *model.Span, asm VarietyAssembler, pbSymbol *pb.Symbol) (res Symbol, err error)

func BasicBoolSymbol

func BasicBoolSymbol(b bool) Symbol

func BasicByteSymbol

func BasicByteSymbol(i byte) Symbol

func BasicInt32Symbol

func BasicInt32Symbol(i int32) Symbol

func BasicInt64Symbol

func BasicInt64Symbol(i int64) Symbol

func BasicStringSymbol

func BasicStringSymbol(s string) Symbol

func DecodeSymbol

func DecodeSymbol(span *model.Span, asm VarietyAssembler, gzipped []byte) (Symbol, error)

func Deconstruct

func Deconstruct(span *model.Span, v reflect.Value) Symbol

Deconstruct a Go value into a Ko value

func DeconstructInterface

func DeconstructInterface(span *model.Span, any interface{}) Symbol

DeconstructInterface deconstructs a Go interface value into a Ko value

func DeconstructKind

func DeconstructKind(span *model.Span, v reflect.Value) Symbol

func Evoke

func Evoke(vty *VarietySymbol, args ...EvokeArg) Symbol

func ExtractMap

func ExtractMap(span *model.Span, s Symbol, mapType reflect.Type) (Symbol, error)

func FindIntegrationKey

func FindIntegrationKey(from *MapSymbol, to reflect.StructField) Symbol

func MakeMapSymbol

func MakeMapSymbol(span *model.Span, m map[string]Symbol) (Symbol, error)

func MakeSeriesSymbol

func MakeSeriesSymbol(span *model.Span, elem Symbols) (Symbol, error)

func MakeStringsSymbol

func MakeStringsSymbol(span *model.Span, ss []string) Symbol

type Symbols

type Symbols []Symbol

func ExtractMonadicNonEmptyIntegerSeries

func ExtractMonadicNonEmptyIntegerSeries(span *model.Span, from *StructSymbol) (_ Symbols, signed bool, _ error)

func FilterEmptySymbols

func FilterEmptySymbols(symbols Symbols) (filtered Symbols)

func (Symbols) Types

func (syms Symbols) Types() Types

type Type

type Type interface {
	// String returns a string representation of the type
	String() string
	tree.Splayer

	// IsType is only used to enforce the implementation of Type
	IsType()

	// GoType returns the Go equivalent of the type.
	GoType() reflect.Type
}

Type implementations: *OptionalType

BasicType, EmptyType,

*SeriesType, *StructType NamedType, *OpaqueType, *MapType VarietyType BlobType

func Optionally

func Optionally(t Type) Type

Optionally makes a type optional, unless it is already optional or series.

func Unify

func Unify(span *model.Span, x, y Type) (Type, error)

func UnifyTypes

func UnifyTypes(span *model.Span, tt []Type) (Type, error)

type Types

type Types []Type

Types is a list of Type's

type VarietyAssembler

type VarietyAssembler interface {
	AssembleMacro(span *model.Span, pkgPath, funcName string) (eval.Macro, error)
}

type VarietySymbol

type VarietySymbol struct {
	Macro eval.Macro   `ko:"name=macro"`
	Arg   FieldSymbols `ko:"name=arg"`
}

func MakeVarietySymbol

func MakeVarietySymbol(macro eval.Macro, arg FieldSymbols) *VarietySymbol

func (*VarietySymbol) Augment

func (vty *VarietySymbol) Augment(span *model.Span, fields eval.Fields) (eval.Shape, eval.Effect, error)

func (*VarietySymbol) DisassembleToGo

func (vty *VarietySymbol) DisassembleToGo(span *model.Span) (reflect.Value, error)

DisassembleToGo converts a Ko value into a Go value

func (*VarietySymbol) DisassembleToPB

func (vty *VarietySymbol) DisassembleToPB(span *model.Span) (*pb.Symbol, error)

DisassembleToPB converts a Ko value into a protobuf

func (*VarietySymbol) Dismentle

func (vty *VarietySymbol) Dismentle(span *model.Span) (pkgPath, funcName string, arg *StructSymbol, err error)

func (*VarietySymbol) Equal

func (vty *VarietySymbol) Equal(span *model.Span, sym Symbol) bool

func (*VarietySymbol) Evoke

func (vty *VarietySymbol) Evoke(span *model.Span, fields eval.Fields) (Symbol, eval.Effect, error)

func (*VarietySymbol) Hash

func (vty *VarietySymbol) Hash(span *model.Span) model.ID

func (*VarietySymbol) Invoke

func (vty *VarietySymbol) Invoke(span *model.Span) (eval.Shape, eval.Effect, error)

func (*VarietySymbol) LiftToSeries

func (vty *VarietySymbol) LiftToSeries(span *model.Span) *SeriesSymbol
func (vty *VarietySymbol) Link(span *model.Span, name string, monadic bool) (eval.Shape, eval.Effect, error)

func (*VarietySymbol) Select

func (vty *VarietySymbol) Select(span *model.Span, path model.Path) (eval.Shape, eval.Effect, error)

func (*VarietySymbol) Splay

func (vty *VarietySymbol) Splay() tree.Tree

func (*VarietySymbol) String

func (vty *VarietySymbol) String() string

func (*VarietySymbol) Type

func (vty *VarietySymbol) Type() Type

type VarietyType

type VarietyType struct{}

VarietyType captures a function type

func (VarietyType) GoType

func (nt VarietyType) GoType() reflect.Type

GoType returns the Go equivalent of the type.

func (VarietyType) IsType

func (VarietyType) IsType()

func (VarietyType) Splay

func (VarietyType) Splay() tree.Tree

func (VarietyType) String

func (VarietyType) String() string

Directories

Path Synopsis
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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