types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAny

func IsAny(t Type) bool

IsAny reports whether t is AnyType.

func IsNumeric

func IsNumeric(t Type) bool

IsNumeric reports whether t is IntType or FloatType.

Types

type AliasType

type AliasType struct {
	Name       string
	Underlying Type
}

AliasType represents a type alias (breed). It is transparent: an AliasType equals its underlying type.

func (AliasType) Equals

func (a AliasType) Equals(t Type) bool

func (AliasType) String

func (a AliasType) String() string

type AnyType

type AnyType struct{}

AnyType is an internal fallback type for built-in operations whose types cannot be statically determined (e.g. head, tail, gag). User code must provide explicit type annotations; AnyType is not part of the user-facing type system.

func (AnyType) Equals

func (AnyType) Equals(t Type) bool

func (AnyType) String

func (AnyType) String() string

type BoolType

type BoolType struct{}

BoolType represents the bool type.

func (BoolType) Equals

func (BoolType) Equals(t Type) bool

func (BoolType) String

func (BoolType) String() string

type CollarType

type CollarType struct {
	Name       string
	Underlying Type
}

CollarType represents a newtype (collar). It is nominal: two CollarTypes are equal only if they share the same name.

func (CollarType) Equals

func (c CollarType) Equals(t Type) bool

func (CollarType) String

func (c CollarType) String() string

type FloatType

type FloatType struct{}

FloatType represents the float type.

func (FloatType) Equals

func (FloatType) Equals(t Type) bool

func (FloatType) String

func (FloatType) String() string

type FuncType

type FuncType struct {
	Params []Type
	Return Type
}

FuncType represents a function type.

func (FuncType) Equals

func (f FuncType) Equals(t Type) bool

func (FuncType) String

func (f FuncType) String() string

type FurballType

type FurballType struct{}

FurballType represents an error (Furball) type.

func (FurballType) Equals

func (FurballType) Equals(t Type) bool

func (FurballType) String

func (FurballType) String() string

type IntType

type IntType struct{}

IntType represents the int type.

func (IntType) Equals

func (IntType) Equals(t Type) bool

func (IntType) String

func (IntType) String() string

type KittyFieldType

type KittyFieldType struct {
	Name string
	Type Type
}

KittyFieldType represents a field in a kitty type.

type KittyType

type KittyType struct {
	Name   string
	Fields []KittyFieldType
}

KittyType represents a user-defined struct type.

func (KittyType) Equals

func (k KittyType) Equals(t Type) bool

func (KittyType) String

func (k KittyType) String() string

type ListType

type ListType struct{ Elem Type }

ListType represents a list type with element type.

func (ListType) Equals

func (l ListType) Equals(t Type) bool

func (ListType) String

func (l ListType) String() string

type NilType

type NilType struct{}

NilType represents the nil type.

func (NilType) Equals

func (NilType) Equals(t Type) bool

func (NilType) String

func (NilType) String() string

type StringType

type StringType struct{}

StringType represents the string type.

func (StringType) Equals

func (StringType) Equals(t Type) bool

func (StringType) String

func (StringType) String() string

type TrickMethodSig

type TrickMethodSig struct {
	Name       string
	ParamTypes []Type
	ReturnType Type
}

TrickMethodSig represents a method signature in a trick.

type TrickType

type TrickType struct {
	Name    string
	Methods []TrickMethodSig
}

TrickType represents a trick (interface) definition.

func (TrickType) Equals

func (t TrickType) Equals(other Type) bool

func (TrickType) String

func (t TrickType) String() string

type Type

type Type interface {
	String() string
	Equals(Type) bool
}

Type represents a Meow type.

func Unwrap

func Unwrap(t Type) Type

Unwrap resolves AliasType wrappers recursively, returning the underlying type. Non-alias types are returned unchanged.

Jump to

Keyboard shortcuts

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