Skip to main content
Home
This release is 1 version behind 0.6.1 — the latest version of @maxdeliso/typed-ski. Jump to latest

Built and signed on GitHub Actions

An implementation of a parser, evaluator, printer, and visualizer for the SKI combinators in TypeScript.

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
a week ago (0.6.0)

default

Typed SKI: parsing, pretty-printing, evaluation, typing, and TripLang compiler.

v
arenaEvaluator

Primary hash-consing arena evaluator used throughout the project.

f
bracketLambda

Public function. Converts an untyped lambda expression (UntypedLambda) into an SKI expression.

f
ChurchN

Creates a Church-encoded numeral from an integer.

f
compile

Full TripLang pipeline: parse → index → elaborate → resolve → typecheck.

f
compileToObjectFile

Compiles a single TripLang source string to a TripCObject.

f
compileToObjectFileString

Compiles a single TripLang source string to a serialized .tripc object file.

f
createArenaEvaluator
No documentation available
v
createArenaEvaluatorRelease
No documentation available
f
emptySystemFContext

Returns an empty System F context.

f
eraseSystemF

Transforms a well–typed System F term into a simply typed lambda term.

f
eraseTypedLambda

Erases type annotations from a simply typed lambda expression.

f
externalReferences

Collects all free (external) term and type references appearing inside a TripLang value.

f
extractDefinitionValue

Extracts the value part of a TripLang definition.

v
I

The I combinator terminal node.

f
indexSymbols

Builds a symbol table for a TripLang program, ensuring all term and type names are unique.

f
inferType

Runs a simplified version of Algorithm W over the given untyped term. Returns a pair of the typed term and its inferred type.

v
K

The K combinator terminal node.

I
ModuleImport

Represents an import declaration in a module.

f
parseLambda

Parses an input string into an untyped lambda term.

f
parseSKI

Parses an input string containing an SKI expression into its AST representation.

f
parseSystemF

Parses an input string into a System F term with EOF checking.

f
parseTripLang

Parses a TripLang program source string into a TripLangProgram AST.

f
parseTypedLambda

Parses an input string into a typed lambda term. Uses parseWithEOF to ensure the entire input is consumed.

I
PolyDefinition

A polymorphic (System F) term definition.

f
prettyPrintSKI

Returns the string representation of a SKI expression.

f
prettyPrintSystemF

Pretty-prints a System F term using λ for term abstraction and Λ for type abstraction.

f
prettyPrintSystemFType

Pretty prints a System F type.

f
prettyPrintTy

Renders a base type as a compact UTF-8 string using ∀ and →.

f
prettyPrintTypedLambda

Pretty-prints a simply typed lambda expression.

f
prettyPrintUntypedLambda

Pretty-prints an untyped lambda expression using λ and parentheses.

f
resolveExternalProgramReferences

Resolves all external references across a program using the provided symbol table.

f
resolveExternalTermReferences

Resolves external references inside a single top-level definition.

f
resolvePoly

Resolves a polymorphic definition by name from a typechecked program.

v
S

The S combinator terminal node.

c
SingleFileCompilerError

Compilation error specific to the single-file compiler

T
SKIExpression

An SKI expression is either a terminal symbol (S, K, I) or an application node.

I
SKITerminal

Represents a terminal symbol in an SKI expression.

E
SKITerminalSymbol

SKI terminal symbol definitions.

T
SystemFTerm

A System F term represents expressions in the polymorphic lambda calculus (System F).

I
TripCObject

Represents the complete object file structure for a compiled TripLang module.

I
TripLangProgram

Root AST node for a TripLang program.

T
TripLangTerm

A top-level TripLang definition or directive.

f
typecheckSystemF

Typechecks a System F term. Returns just the type (discarding the final context).

f
typecheckTyped

Infers the type of a simply typed lambda calculus term under an empty context.

I
TypedDefinition

A simply-typed lambda term definition.

I
TypeDefinition

A named base or arrow/forall type definition.

T
TypedLambda

This recursive type represents the legal terms of the simply typed lambda calculus.

f
UnChurchNumber

Evaluates a Church numeral SKI expression to a JavaScript bigint using the optimized native path.

T
UntypedLambda

The union type representing all possible untyped lambda calculus terms. Includes variables, abstractions, and applications.

f
generateEvaluationForest
No documentation available

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.