typedast

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatType

func FormatType(t interface{}) string

FormatType formats a type for display (interface{} version)

func PrintTypedProgram

func PrintTypedProgram(prog *TypedProgram) string

PrintTypedProgram pretty-prints a typed program

Types

type TypedApp

type TypedApp struct {
	TypedExpr
	Func TypedNode
	Args []TypedNode
}

TypedApp represents typed function application

func (TypedApp) String

func (t TypedApp) String() string

type TypedArray

type TypedArray struct {
	TypedExpr
	Elements []TypedNode
}

TypedArray represents typed array construction

func (TypedArray) String

func (t TypedArray) String() string

type TypedBinOp

type TypedBinOp struct {
	TypedExpr
	Op    string
	Left  TypedNode
	Right TypedNode
}

TypedBinOp represents typed binary operation

func (TypedBinOp) String

func (t TypedBinOp) String() string

type TypedConstructorPattern

type TypedConstructorPattern struct {
	Name string
	Args []TypedPattern
}

func (TypedConstructorPattern) String

func (p TypedConstructorPattern) String() string

type TypedExpr

type TypedExpr struct {
	NodeID    uint64
	Span      ast.Pos
	Type      interface{}   // types.Type - Always monomorphic
	EffectRow interface{}   // *types.Row - Effect row with kind
	Core      core.CoreExpr // Underlying core expression
}

TypedExpr is the base for all typed expressions It carries monomorphic type and effect information

func (TypedExpr) GetCore

func (t TypedExpr) GetCore() core.CoreExpr

func (TypedExpr) GetEffectRow

func (t TypedExpr) GetEffectRow() interface{}

func (TypedExpr) GetNodeID

func (t TypedExpr) GetNodeID() uint64

Implement TypedNode interface for TypedExpr

func (TypedExpr) GetSpan

func (t TypedExpr) GetSpan() ast.Pos

func (TypedExpr) GetType

func (t TypedExpr) GetType() interface{}

type TypedIf

type TypedIf struct {
	TypedExpr
	Cond TypedNode
	Then TypedNode
	Else TypedNode
}

TypedIf represents typed conditional

func (TypedIf) String

func (t TypedIf) String() string

type TypedLambda

type TypedLambda struct {
	TypedExpr
	Params     []string
	ParamTypes []interface{} // []types.Type
	Body       TypedNode
}

TypedLambda represents a typed lambda

func (TypedLambda) String

func (t TypedLambda) String() string

type TypedLet

type TypedLet struct {
	TypedExpr
	Name   string
	Scheme interface{} // *types.Scheme - Generalized type (only here!)
	Value  TypedNode
	Body   TypedNode
}

TypedLet represents a typed let binding Only let bindings carry Schemes (generalized types)

func (TypedLet) String

func (t TypedLet) String() string

type TypedLetRec

type TypedLetRec struct {
	TypedExpr
	Bindings []TypedRecBinding
	Body     TypedNode
}

TypedLetRec represents typed recursive bindings

func (TypedLetRec) String

func (t TypedLetRec) String() string

type TypedList

type TypedList struct {
	TypedExpr
	Elements []TypedNode
}

TypedList represents typed list construction

func (TypedList) String

func (t TypedList) String() string

type TypedListPattern

type TypedListPattern struct {
	Elements []TypedPattern
	Tail     *TypedPattern // For spread patterns: [x, ...rest]
}

func (TypedListPattern) String

func (p TypedListPattern) String() string

type TypedLit

type TypedLit struct {
	TypedExpr
	Kind  core.LitKind
	Value interface{}
}

TypedLit represents a typed literal

func (TypedLit) String

func (t TypedLit) String() string

type TypedLitPattern

type TypedLitPattern struct {
	Value interface{}
}

func (TypedLitPattern) String

func (p TypedLitPattern) String() string

type TypedMatch

type TypedMatch struct {
	TypedExpr
	Scrutinee  TypedNode
	Arms       []TypedMatchArm
	Exhaustive bool
}

TypedMatch represents typed pattern matching

func (TypedMatch) String

func (t TypedMatch) String() string

type TypedMatchArm

type TypedMatchArm struct {
	Pattern TypedPattern
	Guard   TypedNode // Optional
	Body    TypedNode
}

TypedMatchArm represents a typed match arm

type TypedNode

type TypedNode interface {
	GetNodeID() uint64
	GetSpan() ast.Pos
	GetType() interface{}      // types.Type
	GetEffectRow() interface{} // *types.Row
	GetCore() core.CoreExpr
	String() string
}

TypedNode is the interface for all typed nodes

type TypedPattern

type TypedPattern interface {
	String() string
	// contains filtered or unexported methods
}

type TypedProgram

type TypedProgram struct {
	Decls []TypedNode
}

TypedProgram represents a typed program

type TypedRecBinding

type TypedRecBinding struct {
	Name   string
	Scheme interface{} // *types.Scheme - Generalized type for recursive binding
	Value  TypedNode
}

TypedRecBinding represents a recursive binding with scheme

type TypedRecord

type TypedRecord struct {
	TypedExpr
	Fields map[string]TypedNode
}

TypedRecord represents typed record construction

func (TypedRecord) String

func (t TypedRecord) String() string

type TypedRecordAccess

type TypedRecordAccess struct {
	TypedExpr
	Record TypedNode
	Field  string
}

TypedRecordAccess represents typed field access

func (TypedRecordAccess) String

func (t TypedRecordAccess) String() string

type TypedRecordPattern

type TypedRecordPattern struct {
	Fields map[string]TypedPattern
}

func (TypedRecordPattern) String

func (p TypedRecordPattern) String() string

type TypedTuple

type TypedTuple struct {
	TypedExpr
	Elements []TypedNode
}

TypedTuple represents typed tuple construction

func (TypedTuple) String

func (t TypedTuple) String() string

type TypedTuplePattern

type TypedTuplePattern struct {
	Elements []TypedPattern
}

func (TypedTuplePattern) String

func (p TypedTuplePattern) String() string

type TypedUnOp

type TypedUnOp struct {
	TypedExpr
	Op      string
	Operand TypedNode
}

TypedUnOp represents typed unary operation

func (TypedUnOp) String

func (t TypedUnOp) String() string

type TypedVar

type TypedVar struct {
	TypedExpr
	Name string
}

TypedVar represents a typed variable reference

func (TypedVar) String

func (t TypedVar) String() string

String methods for typed nodes

type TypedVarPattern

type TypedVarPattern struct {
	Name string
	Type interface{} // types.Type
}

func (TypedVarPattern) String

func (p TypedVarPattern) String() string

type TypedWildcardPattern

type TypedWildcardPattern struct{}

func (TypedWildcardPattern) String

func (p TypedWildcardPattern) String() string

Jump to

Keyboard shortcuts

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