types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package types contains target-independent semantic types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assignable

func Assignable(target, value Type) bool

func Equivalent

func Equivalent(left, right Type) bool

Equivalent compares semantic types while ignoring binding-level readonly state. Mutable generic containers use it to avoid unsound argument widening.

Types

type Kind

type Kind string
const (
	Invalid       Kind = "invalid"
	Any           Kind = "any"
	Void          Kind = "void"
	Bool          Kind = "bool"
	Int           Kind = "int"
	Float         Kind = "float"
	String        Kind = "string"
	Bytes         Kind = "bytes"
	StringBuilder Kind = "string_builder"
	Array         Kind = "array"
	Range         Kind = "range"
	Iterable      Kind = "iterable"
	Hash          Kind = "hash"
	Named         Kind = "named"
	Nil           Kind = "nil"
)

type Type

type Type struct {
	Kind     Kind
	Name     string
	Args     []Type
	Nullable bool
	Readonly bool
}

func FromName

func FromName(name string) Type

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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