weave

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 FilterEmptyWeaveFields

func FilterEmptyWeaveFields(group []Field) (filtered []Field)

func ParseWeaveOperator

func ParseWeaveOperator(span *Span, ideals Symbol) (Faculty, error)

func ParseWeaverVariety

func ParseWeaverVariety(span *Span, arg *StructSymbol, name string) (*VarietySymbol, error)

Types

type EvalWeaveMacro

type EvalWeaveMacro struct{}

func (EvalWeaveMacro) Doc

func (m EvalWeaveMacro) Doc() string

func (EvalWeaveMacro) Help

func (m EvalWeaveMacro) Help() string

func (EvalWeaveMacro) Invoke

func (EvalWeaveMacro) Invoke(span *Span, arg Arg) (returns Return, effect Effect, err error)

func (EvalWeaveMacro) Label

func (m EvalWeaveMacro) Label() string

func (EvalWeaveMacro) MacroID

func (m EvalWeaveMacro) MacroID() string

func (EvalWeaveMacro) MacroSheathString

func (m EvalWeaveMacro) MacroSheathString() *string

type Weave

type Weave struct {
	Idiom  Repo
	Repo   Repo
	Weaver *Weaver
	Func   *Func
	Ctx    Symbol
	Arg    Symbol
}

func (*Weave) Play

func (b *Weave) Play(origin *Span) (returns, effect Symbol, err error)

type WeaveController

type WeaveController struct {
	Origin  *Span   `ko:"name=origin"` // evaluation span (not weave span)
	Weaver  *Weaver `ko:"name=weaver"`
	Func    *Func   `ko:"name=func"`
	Ctx     Symbol  `ko:"name=ctx"`
	Arg     Symbol  `ko:"name=arg"`
	Program Program `ko:"name=program"`
}

func (*WeaveController) Combine

func (b *WeaveController) Combine(
	weaveSpan *Span,
	_ *Func,
	_ Arg,
	returns Return,
	stepResidues StepResidues,
) (Effect, error)

func (*WeaveController) Enter

func (b *WeaveController) Enter(weaveSpan *Span, arg Arg) (Shape, Effect, error)

func (*WeaveController) Figure

func (b *WeaveController) Figure(weaveSpan *Span, figure Figure) (Shape, Effect, error)

func (*WeaveController) GroupWeaveFields

func (b *WeaveController) GroupWeaveFields(span *Span, fields Fields) (WeaveFields, error)

func (*WeaveController) Interpret

func (b *WeaveController) Interpret(_ Evaluator, f *Func) Macro

func (*WeaveController) Leave

func (b *WeaveController) Leave(weaveSpan *Span, shape Shape) (Return, Effect, error)

func (*WeaveController) Unwrap

func (b *WeaveController) Unwrap(shape Shape) Symbol

func (*WeaveController) UnwrapArg

func (b *WeaveController) UnwrapArg(arg Arg) Symbol

func (*WeaveController) UnwrapEffect

func (b *WeaveController) UnwrapEffect(eff Effect) Symbol

func (*WeaveController) Weave

func (b *WeaveController) Weave() (returns, effect Symbol, err error)

weave forwards eval panics from the caller evaluator environment.

func (*WeaveController) WeaveResidues

func (b *WeaveController) WeaveResidues(stepResidues StepResidues) WeaveResidues

func (*WeaveController) WeaveStepCtx

func (b *WeaveController) WeaveStepCtx(weaveSpan *Span) *WeaveStepCtx

func (*WeaveController) WeaveSummary

func (b *WeaveController) WeaveSummary(returns Symbol) *WeaveSummary

func (*WeaveController) Wrap

func (b *WeaveController) Wrap(symbol Symbol) Shape

func (*WeaveController) WrapEffect

func (b *WeaveController) WrapEffect(symbol Symbol) Effect

type WeaveEffect

type WeaveEffect struct {
	Effect Symbol `ko:"name=effect"`
}

WeaveEffect is an Effect.

func (WeaveEffect) String

func (b WeaveEffect) String() string

type WeaveField

type WeaveField struct {
	Name    string `ko:"name=name"`
	Monadic bool   `ko:"name=monadic"`
	Objects Symbol `ko:"name=objects"`
}

func (*WeaveField) Deconstruct

func (field *WeaveField) Deconstruct(span *Span) Symbol

type WeaveFields

type WeaveFields []*WeaveField

func (WeaveFields) Deconstruct

func (bf WeaveFields) Deconstruct(span *Span) (Symbol, error)

type WeaveFigure

type WeaveFigure struct {
	Int64     *int64          `ko:"name=int64"`
	String    *string         `ko:"name=string"`
	Bool      *bool           `ko:"name=bool"`
	Float64   *float64        `ko:"name=float64"`
	Transform *WeaveTransform `ko:"name=transform"`
}

func (*WeaveFigure) Deconstruct

func (fig *WeaveFigure) Deconstruct(span *Span) Symbol

func (*WeaveFigure) Play

func (fig *WeaveFigure) Play(*runtime.Context) *WeaveFigure

type WeaveFunc

type WeaveFunc struct {
	Pkg  string `ko:"name=pkg"`
	Name string `ko:"name=name"`
}

func (*WeaveFunc) Play

func (w *WeaveFunc) Play(*runtime.Context) *WeaveFunc

type WeaveFuncMacro

type WeaveFuncMacro struct {
	WeavePlaceholderMacro `ko:"name=placeholder"`
	Func                  *Func `ko:"name=func"`
}

type WeaveObject

type WeaveObject struct {
	Controller *WeaveController `ko:"name=controller"`
	Object     Symbol           `ko:"name=object"`
}

WeaveObject is a Shape.

func (WeaveObject) Augment

func (b WeaveObject) Augment(weaveSpan *Span, fields Fields) (Shape, Effect, error)

func (WeaveObject) Invoke

func (b WeaveObject) Invoke(weaveSpan *Span) (Shape, Effect, error)
func (b WeaveObject) Link(weaveSpan *Span, name string, monadic bool) (Shape, Effect, error)

func (WeaveObject) Select

func (b WeaveObject) Select(weaveSpan *Span, path Path) (Shape, Effect, error)

func (WeaveObject) String

func (b WeaveObject) String() string

type WeaveOperator

type WeaveOperator struct {
	Pkg  string `ko:"name=pkg"`
	Name string `ko:"name=name"`
}

func (*WeaveOperator) Play

type WeaveOperatorMacro

type WeaveOperatorMacro struct {
	WeavePlaceholderMacro `ko:"name=placeholder"`
	Ideal                 Ideal `ko:"name=ideal"`
}

type WeavePlaceholderMacro

type WeavePlaceholderMacro struct{}

func (WeavePlaceholderMacro) Doc

func (WeavePlaceholderMacro) Help

func (WeavePlaceholderMacro) Invoke

func (WeavePlaceholderMacro) Invoke(span *Span, arg Arg) (Return, Effect, error)

func (WeavePlaceholderMacro) Label

func (WeavePlaceholderMacro) Label() string

func (WeavePlaceholderMacro) MacroID

func (WeavePlaceholderMacro) MacroID() string

func (WeavePlaceholderMacro) MacroSheathString

func (WeavePlaceholderMacro) MacroSheathString() *string

func (WeavePlaceholderMacro) Splay

func (WeavePlaceholderMacro) Splay() Tree

type WeaveResidue

type WeaveResidue struct {
	Step    string `ko:"name=step"`
	Logic   string `ko:"name=logic"`
	Source  string `ko:"name=source"`
	Returns Symbol `ko:"name=returns"`
	Effect  Symbol `ko:"name=effect"`
}

func (*WeaveResidue) Deconstruct

func (residue *WeaveResidue) Deconstruct(span *Span) Symbol

type WeaveResidues

type WeaveResidues []*WeaveResidue

func (WeaveResidues) Deconstruct

func (br WeaveResidues) Deconstruct(span *Span) (Symbol, error)

type WeaveStepCtx

type WeaveStepCtx struct {
	Origin *Span  `ko:"name=origin"` // evaluation span (not weave span)
	Pkg    string `ko:"name=pkg"`
	Func   string `ko:"name=func"`
	Step   string `ko:"name=step"`
	Logic  string `ko:"name=logic"`
	Source string `ko:"name=source"`
	Ctx    Symbol `ko:"name=ctx"` // user ctx object
}

func (*WeaveStepCtx) Deconstruct

func (ctx *WeaveStepCtx) Deconstruct(span *Span) Symbol

func (*WeaveStepCtx) DelegateSpan

func (ctx *WeaveStepCtx) DelegateSpan() *Span

type WeaveStepResult

type WeaveStepResult struct {
	Returns Symbol `ko:"name=returns"`
	Effect  Symbol `ko:"name=effect"`
}

type WeaveSummary

type WeaveSummary struct {
	Origin  *Span  `ko:"name=origin"` // evaluation span (not weave span)
	Pkg     string `ko:"name=pkg"`
	Func    string `ko:"name=func"`
	Source  string `ko:"name=source"`
	Ctx     Symbol `ko:"name=ctx"` // user ctx object
	Arg     Symbol `ko:"name=arg"`
	Returns Symbol `ko:"name=returns"`
}

func (*WeaveSummary) CombineSpan

func (summary *WeaveSummary) CombineSpan() *Span

func (*WeaveSummary) Deconstruct

func (summary *WeaveSummary) Deconstruct(span *Span) Symbol

type WeaveTransform

type WeaveTransform struct {
	Operator *WeaveOperator `ko:"name=operator"`
	Func     *WeaveFunc     `ko:"name=func"`
}

func (*WeaveTransform) Play

type Weaver

type Weaver struct {
	Operator       Faculty        `ko:"name=operator"`
	EnterVariety   *VarietySymbol `ko:"name=Enter"`
	LeaveVariety   *VarietySymbol `ko:"name=Leave"`
	LiteralVariety *VarietySymbol `ko:"name=Literal"`
	LinkVariety    *VarietySymbol `ko:"name=Link"`
	SelectVariety  *VarietySymbol `ko:"name=Select"`
	AugmentVariety *VarietySymbol `ko:"name=Augment"`
	InvokeVariety  *VarietySymbol `ko:"name=Invoke"`
	CombineVariety *VarietySymbol `ko:"name=Combine"`
}

func ParseWeaver

func ParseWeaver(span *Span, a Symbol) (_ *Weaver, err error)

func (*Weaver) Augment

func (b *Weaver) Augment(ctx *WeaveStepCtx, object Symbol, fields WeaveFields) (*WeaveStepResult, error)

func (*Weaver) Combine

func (b *Weaver) Combine(summary *WeaveSummary, steps WeaveResidues) (*WeaveStepResult, error)

func (*Weaver) Enter

func (b *Weaver) Enter(ctx *WeaveStepCtx, object Symbol) (*WeaveStepResult, error)

func (*Weaver) Invoke

func (b *Weaver) Invoke(ctx *WeaveStepCtx, object Symbol) (*WeaveStepResult, error)

func (*Weaver) Leave

func (b *Weaver) Leave(ctx *WeaveStepCtx, object Symbol) (*WeaveStepResult, error)
func (b *Weaver) Link(ctx *WeaveStepCtx, object Symbol, name string, monadic bool) (*WeaveStepResult, error)

func (*Weaver) Literal

func (b *Weaver) Literal(ctx *WeaveStepCtx, figure *WeaveFigure) (*WeaveStepResult, error)

func (*Weaver) Select

func (b *Weaver) Select(ctx *WeaveStepCtx, object Symbol, path Path) (*WeaveStepResult, error)

Jump to

Keyboard shortcuts

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