psl4

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package psl4 provides PSL 4.0 language features: dependent types, effects, macros, type inference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DependentType

type DependentType struct {
	Field     string            `json:"field"`
	DependsOn string            `json:"depends_on"`
	TypeMap   map[string]string `json:"type_map"` // value → type
}

DependentType represents a dependent type where field type depends on another field's value.

type Effect

type Effect struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Pure        bool   `json:"pure"`
}

Effect represents a side effect annotation.

type Macro

type Macro struct {
	Name       string   `json:"name"`
	Parameters []string `json:"parameters"`
	Body       string   `json:"body"`
}

Macro represents a compile-time macro.

type PSL4Features

type PSL4Features struct {
	DependentTypes []DependentType `json:"dependent_types"`
	Effects        []Effect        `json:"effects"`
	Macros         []Macro         `json:"macros"`
}

PSL4Features holds all PSL 4.0 language features.

func NewFeatures

func NewFeatures() *PSL4Features

NewFeatures creates PSL 4.0 features with examples.

func (*PSL4Features) Describe

func (f *PSL4Features) Describe() string

Describe returns a description of PSL 4.0 features.

type TypeInference

type TypeInference struct {
	Field        string  `json:"field"`
	InferredType string  `json:"inferred_type"`
	Confidence   float64 `json:"confidence"`
}

TypeInference represents a type inference result.

func InferTypes

func InferTypes(fields map[string]string) []TypeInference

InferTypes performs type inference on field definitions.

Jump to

Keyboard shortcuts

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