GlispGlisp
Home
Guide
Playground
  • Overview
  • Syntax
  • Types
  • Evaluation
  • Host API
API
  • English
  • 日本語
GitHub
Home
Guide
Playground
  • Overview
  • Syntax
  • Types
  • Evaluation
  • Host API
API
  • English
  • 日本語
GitHub
  • API

    • glisp
    • build
    • check
    • eval
    • expand
    • expectedType
    • infer
    • lex
    • parse
    • print
    • session
    • types

glisp


glisp / infer

infer

Functions

infer()

infer(ast, env): TypeValue | null

Defined in: infer.ts:44

Statically infer the TypeValue of ast against env without evaluating it. Returns null when the inferred type cannot be determined (for example, a free variable, or an expression whose head is not a function-typed value).

Used by check.ts to surface type-mismatch diagnostics without running the program, and by the evaluator’s typed-host-fn path to skip evaluating arguments that already statically mismatch their declared parameter type.

Parameters

ParameterType
astAST
envEnv

Returns

TypeValue | null

Edit this page
Prev
expectedType
Next
lex