tree

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBuiltinKind

func IsBuiltinKind(kind reflect.Kind) bool

func NameWithMonadicity

func NameWithMonadicity(name string, monadic bool) string

func RenderTreeString

func RenderTreeString(text Textual) string

func Sprint

func Sprint(v interface{}) string

func SprintType

func SprintType(t reflect.Type) string

func StructFieldIsExported

func StructFieldIsExported(f reflect.StructField) bool

func TypeName

func TypeName(t reflect.Type) string

Types

type Cycle

type Cycle struct{}

Cycle is a tree.

func (Cycle) Text

func (v Cycle) Text() Textual

func (Cycle) TreeHash

func (v Cycle) TreeHash() string

type ExplainCtx

type ExplainCtx struct{}

func (*ExplainCtx) Explain

func (ctx *ExplainCtx) Explain(t reflect.Type) Tree

func (*ExplainCtx) ExplainNoName

func (ctx *ExplainCtx) ExplainNoName(t reflect.Type) Tree

type GoValue

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

GoValue is a tree.

func (GoValue) Text

func (v GoValue) Text() Textual

func (GoValue) TreeHash

func (v GoValue) TreeHash() string

From Go doc:

func (v Value) String() string
    String returns the string v's underlying value, as a string. String is a
    special case because of Go's String method convention. Unlike the other
    getters, it does not panic if v's Kind is not String. Instead, it returns a
    string of the form "<T value>" where T is v's type. The fmt package treats
    Values specially. It does not call their String method implicitly but
    instead prints the concrete values they hold.

type IndexTree

type IndexTree struct {
	Index int `ko:"name=index"`
	Tree  `ko:"name=tree"`
}

type Label

type Label struct {
	Path string `ko:"name=path"`
	Name string `ko:"name=name"`
}

func TypeLabel

func TypeLabel(t reflect.Type) Label

func (Label) IsEmpty

func (l Label) IsEmpty() bool

type MultiSet

type MultiSet []MultiSetElem

func (MultiSet) Add

func (mset MultiSet) Add(elem interface{}) MultiSet

func (MultiSet) Copy

func (mset MultiSet) Copy() MultiSet

func (MultiSet) Count

func (mset MultiSet) Count(elem interface{}) int

func (MultiSet) Size

func (mset MultiSet) Size() int

type MultiSetElem

type MultiSetElem struct {
	Elem  interface{}
	Count int
}

type NameTree

type NameTree struct {
	Name    KoGoName `ko:"name=name"`
	Monadic bool     `ko:"name=monadic"`
	Tree    `ko:"name=tree"`
}

type NoQuote

type NoQuote struct {
	String_ string `ko:"name=string"`
}

NoQuote is a tree.

func (NoQuote) Text

func (v NoQuote) Text() Textual

func (NoQuote) TreeHash

func (v NoQuote) TreeHash() string

type Opaque

type Opaque struct{}

Opaque is a tree.

func (Opaque) Text

func (v Opaque) Text() Textual

func (Opaque) TreeHash

func (v Opaque) TreeHash() string

type Parallel

type Parallel struct {
	Label   Label      `ko:"name=label"`
	Bracket string     `ko:"name=bracket"` // "{}", "[]"
	Elem    []NameTree `ko:"name=field"`
}

Parallel is a tree.

func (Parallel) Text

func (parallel Parallel) Text() Textual

func (Parallel) TreeHash

func (parallel Parallel) TreeHash() string

type Quote

type Quote struct {
	String_ string `ko:"name=string"`
}

Quote is a tree.

func (Quote) Text

func (v Quote) Text() Textual

func (Quote) TreeHash

func (v Quote) TreeHash() string

type Relabeler

type Relabeler interface {
	Relabel() Label
}

type Series

type Series struct {
	Label   Label       `ko:"name=label"`
	Bracket string      `ko:"name=bracket"` // "{}", "[]"
	Elem    []IndexTree `ko:"name=elem"`
}

Series is a tree.

func (Series) Text

func (series Series) Text() Textual

func (Series) TreeHash

func (series Series) TreeHash() string

type Sometimes

type Sometimes struct {
	Elem Tree `ko:"name=elem"`
}

Sometimes is a tree.

func (Sometimes) Text

func (v Sometimes) Text() Textual

func (Sometimes) TreeHash

func (v Sometimes) TreeHash() string

type SplayCtx

type SplayCtx struct {
	Seen MultiSet `ko:"name=seen"`
}

func (*SplayCtx) Cache

func (ctx *SplayCtx) Cache(x interface{}) *SplayCtx

func (*SplayCtx) SplayValue

func (ctx *SplayCtx) SplayValue(v reflect.Value) Tree

type Splayer

type Splayer interface {
	Splay() Tree
}

type Tree

type Tree interface {
	Text() Textual
	TreeHash() string
}

func Explain

func Explain(t reflect.Type) Tree

func Splay

func Splay(v interface{}) Tree

Jump to

Keyboard shortcuts

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