typed

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

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

func (*Access) Children

func (e *Access) Children() []Statement

func (*Access) Code

func (e *Access) Code(currentModule ast.QualifiedIdentifier) string

func (Access) Location

func (e Access) Location() ast.Location

func (Access) Type

func (e Access) Type() Type

type Apply

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

func (*Apply) Children

func (e *Apply) Children() []Statement

func (*Apply) Code

func (e *Apply) Code(currentModule ast.QualifiedIdentifier) string

func (*Apply) Func

func (e *Apply) Func() Expression

func (Apply) Location

func (e Apply) Location() ast.Location

func (Apply) Type

func (e Apply) Type() Type

type Call

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

func (*Call) Children

func (e *Call) Children() []Statement

func (*Call) Code

func (e *Call) Code(currentModule ast.QualifiedIdentifier) string

func (Call) Location

func (e Call) Location() ast.Location

func (Call) Type

func (e Call) Type() Type

type Const

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

func (Const) Children

func (e Const) Children() []Statement

func (*Const) Code

func (e *Const) Code(currentModule ast.QualifiedIdentifier) string

func (Const) Location

func (e Const) Location() ast.Location

func (Const) Type

func (e Const) Type() Type

type Constructor

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

func (*Constructor) Children

func (e *Constructor) Children() []Statement

func (*Constructor) Code

func (e *Constructor) Code(currentModule ast.QualifiedIdentifier) string

func (*Constructor) DataName

func (e *Constructor) DataName() ast.FullIdentifier

func (Constructor) Location

func (e Constructor) Location() ast.Location

func (Constructor) Type

func (e Constructor) Type() Type

type DataOption

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

func NewDataOption

func NewDataOption(name ast.DataOptionIdentifier, values []Type) *DataOption

func (*DataOption) Children

func (d *DataOption) Children() []Statement

func (*DataOption) String

func (d *DataOption) String() string

type Definition

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

func NewDefinition

func NewDefinition(
	location ast.Location,
	id uint64,
	hidden bool,
	name ast.Identifier,
	nameLocation ast.Location,
) *Definition

func (*Definition) Body

func (def *Definition) Body() Expression

func (*Definition) Bytecode

func (def *Definition) Bytecode(pathId ast.FullIdentifier, modName ast.QualifiedIdentifier, binary *bytecode.Binary, hash *bytecode.BinaryHash) bytecode.Func

func (*Definition) Children

func (def *Definition) Children() []Statement

func (*Definition) Code

func (def *Definition) Code(currentModule ast.QualifiedIdentifier) string

func (*Definition) DeclaredType

func (def *Definition) DeclaredType() Type

func (*Definition) Id

func (def *Definition) Id() uint64

func (*Definition) Location

func (def *Definition) Location() ast.Location

func (*Definition) Name

func (def *Definition) Name() ast.Identifier

func (*Definition) NameLocation

func (def *Definition) NameLocation() ast.Location

func (*Definition) Params

func (def *Definition) Params() []Pattern

func (*Definition) SetDeclaredType

func (def *Definition) SetDeclaredType(declaredType Type)

func (*Definition) SetExpression

func (def *Definition) SetExpression(body Expression)

func (*Definition) SetParams

func (def *Definition) SetParams(params []Pattern)

func (*Definition) SolvingContext

func (def *Definition) SolvingContext() *SolvingContext

type Equation

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

func NewEquation

func NewEquation(stmt Statement, left Type, right Type) Equation

func NewEquationBestLoc

func NewEquationBestLoc(left Type, right Type, enclosing ast.Location) Equation

func (Equation) String

func (eq Equation) String(index int) string

type Equations

type Equations []Equation

func (Equations) String

func (eqs Equations) String() string

type Expression

type Expression interface {
	Statement

	Type() Type
	// contains filtered or unexported methods
}

func NewAccess

func NewAccess(ctx *SolvingContext, loc ast.Location, fieldName ast.Identifier, record Expression) Expression

func NewApply

func NewApply(ctx *SolvingContext, loc ast.Location, func_ Expression, args []Expression) (Expression, error)

func NewCall

func NewCall(ctx *SolvingContext, loc ast.Location, name ast.FullIdentifier, args []Expression) (Expression, error)

func NewConst

func NewConst(ctx *SolvingContext, loc ast.Location, value ast.ConstValue) Expression

func NewConstructor

func NewConstructor(
	ctx *SolvingContext, loc ast.Location,
	dataName ast.FullIdentifier, optionName ast.Identifier,
	dataType *TData, args []Expression,
) Expression

func NewGlobal

func NewGlobal(
	ctx *SolvingContext, loc ast.Location,
	moduleName ast.QualifiedIdentifier, definitionName ast.Identifier,
	targetDef *Definition,
) Expression

func NewLet

func NewLet(ctx *SolvingContext, loc ast.Location, pattern Pattern, value Expression, body Expression) Expression

func NewList

func NewList(ctx *SolvingContext, loc ast.Location, items []Expression) Expression

func NewLocal

func NewLocal(ctx *SolvingContext, loc ast.Location, name ast.Identifier, target Pattern) Expression

func NewRecord

func NewRecord(ctx *SolvingContext, loc ast.Location, fields []*RecordField) Expression

func NewSelect

func NewSelect(ctx *SolvingContext, loc ast.Location, condition Expression, cases []*SelectCase) Expression

func NewTuple

func NewTuple(ctx *SolvingContext, loc ast.Location, items []Expression) Expression

func NewUpdateGlobal

func NewUpdateGlobal(
	ctx *SolvingContext, loc ast.Location,
	moduleName ast.QualifiedIdentifier, definitionName ast.Identifier,
	targetDef *Definition, fields []*RecordField,
) Expression

func NewUpdateLocal

func NewUpdateLocal(
	ctx *SolvingContext, loc ast.Location,
	recordName ast.Identifier, target Pattern, fields []*RecordField,
) Expression

type Global

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

func (Global) Children

func (e Global) Children() []Statement

func (*Global) Code

func (e *Global) Code(currentModule ast.QualifiedIdentifier) string

func (*Global) Definition

func (e *Global) Definition() *Definition

func (Global) Location

func (e Global) Location() ast.Location

func (Global) Type

func (e Global) Type() Type

type Let

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

func (*Let) Children

func (e *Let) Children() []Statement

func (*Let) Code

func (e *Let) Code(currentModule ast.QualifiedIdentifier) string

func (Let) Location

func (e Let) Location() ast.Location

func (Let) Type

func (e Let) Type() Type

type List

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

func (*List) Children

func (e *List) Children() []Statement

func (*List) Code

func (e *List) Code(currentModule ast.QualifiedIdentifier) string

func (List) Location

func (e List) Location() ast.Location

func (List) Type

func (e List) Type() Type

type Local

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

func (Local) Children

func (e Local) Children() []Statement

func (*Local) Code

func (e *Local) Code(currentModule ast.QualifiedIdentifier) string

func (Local) Location

func (e Local) Location() ast.Location

func (*Local) Target

func (e *Local) Target() Pattern

func (Local) Type

func (e Local) Type() Type

type Module

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

func NewModule

func NewModule(
	location ast.Location,
	name ast.QualifiedIdentifier,
	dependencies map[ast.QualifiedIdentifier][]ast.Identifier,
	definitions []*Definition,
) *Module

func (*Module) AddDefinition

func (module *Module) AddDefinition(def *Definition)

func (*Module) CheckPatterns

func (module *Module) CheckPatterns() (errors []error)

func (*Module) CheckTypes

func (module *Module) CheckTypes() (errors []error)

func (*Module) Compose

func (module *Module) Compose(
	modules map[ast.QualifiedIdentifier]*Module, debug bool, binary *bytecode.Binary, hash *bytecode.BinaryHash,
) error

func (*Module) FindDefinition

func (module *Module) FindDefinition(name ast.Identifier) (*Definition, bool)

func (*Module) Location

func (module *Module) Location() ast.Location

type PAlias

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

func (*PAlias) Children

func (p *PAlias) Children() []Statement

func (*PAlias) Code

func (p *PAlias) Code(currentModule ast.QualifiedIdentifier) string

func (PAlias) DeclaredType

func (p PAlias) DeclaredType() Type

func (PAlias) Location

func (p PAlias) Location() ast.Location

func (PAlias) Type

func (p PAlias) Type() Type

type PAny

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

func (PAny) Children

func (p PAny) Children() []Statement

func (*PAny) Code

func (p *PAny) Code(currentModule ast.QualifiedIdentifier) string

func (PAny) DeclaredType

func (p PAny) DeclaredType() Type

func (PAny) Location

func (p PAny) Location() ast.Location

func (PAny) Type

func (p PAny) Type() Type

type PCons

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

func (*PCons) Children

func (p *PCons) Children() []Statement

func (*PCons) Code

func (p *PCons) Code(currentModule ast.QualifiedIdentifier) string

func (PCons) DeclaredType

func (p PCons) DeclaredType() Type

func (PCons) Location

func (p PCons) Location() ast.Location

func (PCons) Type

func (p PCons) Type() Type

type PConst

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

func (PConst) Children

func (p PConst) Children() []Statement

func (*PConst) Code

func (p *PConst) Code(currentModule ast.QualifiedIdentifier) string

func (PConst) DeclaredType

func (p PConst) DeclaredType() Type

func (PConst) Location

func (p PConst) Location() ast.Location

func (PConst) Type

func (p PConst) Type() Type

type PList

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

func (*PList) Children

func (p *PList) Children() []Statement

func (*PList) Code

func (p *PList) Code(currentModule ast.QualifiedIdentifier) string

func (PList) DeclaredType

func (p PList) DeclaredType() Type

func (PList) Location

func (p PList) Location() ast.Location

func (PList) Type

func (p PList) Type() Type

type PNamed

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

func (PNamed) Children

func (p PNamed) Children() []Statement

func (*PNamed) Code

func (p *PNamed) Code(currentModule ast.QualifiedIdentifier) string

func (PNamed) DeclaredType

func (p PNamed) DeclaredType() Type

func (PNamed) Location

func (p PNamed) Location() ast.Location

func (PNamed) Type

func (p PNamed) Type() Type

type POption

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

func (*POption) Children

func (p *POption) Children() []Statement

func (*POption) Code

func (p *POption) Code(currentModule ast.QualifiedIdentifier) string

func (POption) DeclaredType

func (p POption) DeclaredType() Type

func (*POption) Definition

func (p *POption) Definition() *Definition

func (POption) Location

func (p POption) Location() ast.Location

func (POption) Type

func (p POption) Type() Type

type PRecord

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

func (*PRecord) Children

func (p *PRecord) Children() []Statement

func (*PRecord) Code

func (p *PRecord) Code(currentModule ast.QualifiedIdentifier) string

func (PRecord) DeclaredType

func (p PRecord) DeclaredType() Type

func (PRecord) Location

func (p PRecord) Location() ast.Location

func (PRecord) Type

func (p PRecord) Type() Type

type PRecordField

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

func NewPRecordField

func NewPRecordField(
	ctx *SolvingContext, loc ast.Location, name ast.Identifier, declaredType Type,
) *PRecordField

func (PRecordField) Code

func (f PRecordField) Code(currentModule ast.QualifiedIdentifier) string

func (PRecordField) Location

func (f PRecordField) Location() ast.Location

type PTuple

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

func (*PTuple) Children

func (p *PTuple) Children() []Statement

func (*PTuple) Code

func (p *PTuple) Code(currentModule ast.QualifiedIdentifier) string

func (PTuple) DeclaredType

func (p PTuple) DeclaredType() Type

func (PTuple) Location

func (p PTuple) Location() ast.Location

func (PTuple) Type

func (p PTuple) Type() Type

type Pattern

type Pattern interface {
	Statement

	Type() Type
	DeclaredType() Type
	// contains filtered or unexported methods
}

func NewPAlias

func NewPAlias(ctx *SolvingContext, loc ast.Location, declaredType Type, alias ast.Identifier, nested Pattern) Pattern

func NewPAny

func NewPAny(ctx *SolvingContext, loc ast.Location, declaredType Type) Pattern

func NewPCons

func NewPCons(ctx *SolvingContext, loc ast.Location, declaredType Type, head Pattern, tail Pattern) Pattern

func NewPConst

func NewPConst(ctx *SolvingContext, loc ast.Location, declaredType Type, value ast.ConstValue) Pattern

func NewPList

func NewPList(ctx *SolvingContext, loc ast.Location, declaredType Type, items []Pattern) Pattern

func NewPNamed

func NewPNamed(ctx *SolvingContext, loc ast.Location, declaredType Type, name ast.Identifier) Pattern

func NewPOption

func NewPOption(
	ctx *SolvingContext, loc ast.Location, declaredType Type,
	definition *Definition, args []Pattern,
) (Pattern, error)

func NewPRecord

func NewPRecord(ctx *SolvingContext, loc ast.Location, declaredType Type, fields []*PRecordField) Pattern

func NewPTuple

func NewPTuple(ctx *SolvingContext, loc ast.Location, declaredType Type, items []Pattern) (Pattern, error)

type Record

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

func (*Record) Children

func (e *Record) Children() []Statement

func (*Record) Code

func (e *Record) Code(currentModule ast.QualifiedIdentifier) string

func (Record) Location

func (e Record) Location() ast.Location

func (Record) Type

func (e Record) Type() Type

type RecordField

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

func NewRecordField

func NewRecordField(
	ctx *SolvingContext, loc ast.Location, name ast.Identifier, value Expression,
) *RecordField

func (RecordField) Code

func (r RecordField) Code(currentModule ast.QualifiedIdentifier) string

func (RecordField) Location

func (r RecordField) Location() ast.Location

type Select

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

func (*Select) Children

func (e *Select) Children() []Statement

func (*Select) Code

func (e *Select) Code(currentModule ast.QualifiedIdentifier) string

func (Select) Location

func (e Select) Location() ast.Location

func (Select) Type

func (e Select) Type() Type

type SelectCase

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

func NewSelectCase

func NewSelectCase(loc ast.Location, pattern Pattern, expression Expression) *SelectCase

type SolvingContext

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

type Statement

type Statement interface {
	ast.Coder
	Location() ast.Location
	Children() []Statement
}

type TData

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

func (*TData) Children

func (t *TData) Children() []Statement

func (*TData) Code

func (t *TData) Code(currentModule ast.QualifiedIdentifier) string

func (TData) Location

func (t TData) Location() ast.Location

func (*TData) Name

func (t *TData) Name() ast.FullIdentifier

func (*TData) SetOptions

func (t *TData) SetOptions(options []*DataOption)

type TFunc

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

func (*TFunc) Children

func (t *TFunc) Children() []Statement

func (*TFunc) Code

func (t *TFunc) Code(currentModule ast.QualifiedIdentifier) string

func (TFunc) Location

func (t TFunc) Location() ast.Location

func (*TFunc) NumParams

func (t *TFunc) NumParams() int

func (*TFunc) ParamAt

func (t *TFunc) ParamAt(index int) Type

func (*TFunc) Params

func (t *TFunc) Params() []Type

func (*TFunc) Return

func (t *TFunc) Return() Type

type TNative

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

func (*TNative) Children

func (t *TNative) Children() []Statement

func (*TNative) Code

func (t *TNative) Code(currentModule ast.QualifiedIdentifier) string

func (TNative) Location

func (t TNative) Location() ast.Location

func (*TNative) Name

func (t *TNative) Name() ast.FullIdentifier

func (*TNative) String

func (t *TNative) String() string

type TRecord

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

func (*TRecord) Children

func (t *TRecord) Children() []Statement

func (*TRecord) Code

func (t *TRecord) Code(currentModule ast.QualifiedIdentifier) string

func (*TRecord) Fields

func (t *TRecord) Fields() map[ast.Identifier]Type

func (TRecord) Location

func (t TRecord) Location() ast.Location

type TTuple

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

func (*TTuple) Children

func (t *TTuple) Children() []Statement

func (*TTuple) Code

func (t *TTuple) Code(currentModule ast.QualifiedIdentifier) string

func (TTuple) Location

func (t TTuple) Location() ast.Location

type TUnbound

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

func (*TUnbound) Children

func (t *TUnbound) Children() []Statement

func (*TUnbound) Code

func (t *TUnbound) Code(currentModule ast.QualifiedIdentifier) string

func (TUnbound) Location

func (t TUnbound) Location() ast.Location

func (*TUnbound) String

func (t *TUnbound) String() string

type Tuple

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

func (Tuple) Children

func (e Tuple) Children() []Statement

func (Tuple) Code

func (e Tuple) Code(currentModule ast.QualifiedIdentifier) string

func (Tuple) Location

func (e Tuple) Location() ast.Location

func (Tuple) Type

func (e Tuple) Type() Type

type Type

type Type interface {
	Statement
	// contains filtered or unexported methods
}

func NewTData

func NewTData(loc ast.Location, name ast.FullIdentifier, args []Type, options []*DataOption) Type

func NewTFunc

func NewTFunc(loc ast.Location, params []Type, return_ Type) Type

func NewTNative

func NewTNative(loc ast.Location, name ast.FullIdentifier, args []Type) Type

func NewTParameter

func NewTParameter(ctx *SolvingContext, loc ast.Location, predecessor TypePredecessor, name ast.Identifier) Type

func NewTRecord

func NewTRecord(loc ast.Location, fields map[ast.Identifier]Type, mayHaveMoreFields bool) Type

func NewTTuple

func NewTTuple(loc ast.Location, items []Type) Type

type TypePredecessor

type TypePredecessor interface {
	SetSuccessor(Type) Type
}

type Update

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

func (*Update) Children

func (e *Update) Children() []Statement

func (*Update) Code

func (e *Update) Code(currentModule ast.QualifiedIdentifier) string

func (Update) Location

func (e Update) Location() ast.Location

func (Update) Type

func (e Update) Type() Type

Jump to

Keyboard shortcuts

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