liveBook · Manning

Untype

As explained in Building User-Friendly DSLs

A special type-system result indicating that no sensible type can be computed for an expression.

Untype is a special type-system result meaning that no sensible type can be computed for an expression. A typeOf function returns the string "untype" when neither an obviously correct type nor a useful best-effort type exists, allowing callers to handle the failure explicitly. section 13.1 section 13.4

Untype should not spread blindly through an expression tree. Best-effort types and untype can bubble from subexpressions to their ancestors, so type computation should continue trying to produce a useful type and preserve the root problem’s location. section 13.1 section 13.4

How Building User-Friendly DSLs covers it

How deep it goes
Defines untype, implements fallback rules, and warns against propagating it without preserving root-error location.
Examples
Uses binary-operation tables and JavaScript typeOf cases for unsupported operators, operands, references, and AST objects.
What it assumes
Assumes expressions, subexpressions, typeOf, and AST objects while teaching untype as a special type-system result.
What you can do after
Diagnose type-computation failures while retaining useful best-effort types for surrounding expressions.
How it connects
Connects untype to type computation, type inference, type checking constraints, expressions, subexpressions, and abstract syntax trees.

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.