File inlining with inline "file" expression - Compose Keel programs from multiple files using inline as an expression that returns a record of exposed values: (4fdf44d) (f2c63c8) (05f3c4b)
inline "file" passing (vars) is an expression returning a record of all exposed values
Lenient parser mode - KeelParser::parse_file_lenient() returns best-effort AST alongside errors, enabling compilation of files where variables are introduced at compile time (e.g., module param bindings in imported files) (05f3c4b)
Pre-parse delimiter balancing - An O(n) token scan runs before the parser to detect mismatched, unclosed, or unexpected delimiters with precise, actionable error messages: (590c4b4)
SourceError hint tests - Added 4 tests for SourceError::hint() covering parentheses, brackets, braces, and no-match cases (b028d62)
ErrorHint for SourceError - Parse errors from chumsky (unmatched parens, brackets, braces) now provide actionable hints like "Check for a missing closing ).": (7dcfe79)
Doc comment panic test - Added test_doc_comment_does_not_panic to verify {-| doc comment -} compiles without panicking (7dcfe79)
Space-separated arguments for custom enum variants - Custom enum variants now support space-separated syntax for single arguments, matching the style of built-in types like Just 5. Both MyEnum::Variant(arg) and MyEnum::Variant arg are now valid: (37b2ed8)
Doc comments ({-| ... -}) - Elm-style doc comments for distinguishing documentation from implementation notes. Doc comments are lexed as Token::DocComment, parsed into Comment { is_doc: true } AST nodes, and preferred over regular comments in LSP hover output: (37b2ed8)
Comprehensive doc comment test suite (27 new tests) (37b2ed8)
Lexer tests (tests/lexer/lexer_doc_comments.rs, 17 tests): basic tokenization, content preservation (multiline, indented, special characters), distinction from block comments, interaction with surrounding tokens (fn, let, module), consecutive doc comments, edge cases (start/end of file, nested syntax)
Compiler integration tests (tests/compiler/doc_comments.rs, 10 tests): doc comments before functions, modules, let bindings, between declarations, multiple/multiline doc comments, mixed with line comments, standalone doc comments, verification that doc comments don't affect execution results
Native functions work with pipe operators and composition - Native stdlib functions (String.toUpper, List.length, Math.abs, etc.) now work correctly with pipe operators (|>), function composition (>>), and partial application: (e49ca6e)
Helpful error for missing parentheses in enum variants - When users write Ok a instead of Ok(a) in enum definitions, they now get a clear error instead of a confusing "unused type parameter" message: (02189d0)
Compiler support for typed record fields in lambda patterns - Type annotations on record fields in lambda patterns are now fully supported by the compiler: (925f6c2)
Standalone typed record lambdas work without requiring pipe context:
Type mismatch detection catches when annotated types conflict with actual values:
Mixed typed and untyped fields work correctly (untyped fields inferred from context):
Complex types like Int -> Int and List Int are supported in field annotations
Type annotations on record fields in lambda patterns - Record fields in lambda patterns can now have type annotations, just like tuple patterns: (925f6c2)
{ name: String } - String is a type annotation
{ name: n } - n is a pattern (variable binding)
Helpful error for tuple pattern type annotations - When users try to type-annotate a tuple pattern as a whole instead of its individual elements, they now get a helpful error message: (5faf3e8)
Tuple types as function arguments - Function signatures can now use tuple types directly as arguments. Previously, tuple types like (Int, String) were forbidden in function argument positions by the parser. This restriction has been removed: (cb2ce25)
Time Machine Debugger (behind time-machine feature flag) - A comprehensive debugging tool that captures state across all compilation and execution phases: (18ded36)
Unified Timeline: Tracks entries from lexer (tokens), parser (AST nodes), compiler (bytecode), and VM (execution) in chronological order
Bidirectional Navigation: Step forward/backward through the entire timeline or within a specific phase
Source Mapping: Full bidirectional mapping between source code byte offsets, tokens, AST nodes, and bytecode instructions
Cross-Phase Navigation: Jump from any token to its AST nodes, from AST to bytecode, from bytecode to VM executions (and back)
Integration Helpers: TimeMachineRecorder for easy recording during compilation
Enable with: cargo build --features time-machine
100% error hint coverage - All 115 error variants across LexerError, ParserError, ScopeError, TypeError, CompileError, and VmError now have helpful hint() and note() implementations. Coverage improved from 62% to 100%: (8b4dc98)
LexerError: Added hints for InvalidInt, InvalidFloat, and UnknownToken
ParserError: Added hints for EnumInvalidEntry, ModuleInvalidExposedFunction, ModuleInvalidExposedType, ModuleInlineNoName, TypeDefinitionMissing, UndeclaredEnum, EnumVariantNotFound, NotAnEnum, and Unknown
VmError: Added hints for InvalidTuple, InvalidList, InvalidRecord, ConstantIndexOutOfBounds, UnsupportedOperation, UnexpectedInstruction, InvalidRecordSource, and MultipleTypeErrors
All new hints include both actionable suggestions and contextual notes
Added 93 new tests covering all error hint implementations
Parenthesized types for grouping in type annotations - Type annotations now support parentheses for grouping compound types as single arguments. This allows writing types like Result (Maybe Int) String where (Maybe Int) is grouped as the first type parameter: (ac2d3b2)
Type::Never (uninhabited type) - Added a new type representing unreachable code branches, similar to Rust's !, Haskell's Void, and TypeScript's never. This is used internally for pattern matching on sum types with unknown type parameters. (4f826da)
Module enum exports and imports - Enums can now be exported from modules and used correctly in importing code: (ced4afb)
Exported enums are now registered in the parent scope for type checking
Type::Custom is now resolved to Type::Enum when the custom type is a declared enum
Import handling correctly loads user-defined function closures instead of overwriting them
Both exposing (..) and specific exposing (Type, fn) syntax work correctly
Qualified enum syntax in patterns (Color::Green) - Enum patterns now support the same qualified syntax as expressions, providing consistency across the language: (ebcf001)
Rest pattern syntax (..) for record patterns - Keel now supports Rust-style rest patterns to ignore remaining fields when destructuring records: (2b134d3)
Helpful error for type Name = { record } syntax mistake - When users accidentally write type Person = { name: String, age: Int } instead of type alias Person = { ... }, they now get a clear error message instead of a confusing parse error: (ac2c034)
"Did you mean?" suggestions for module function typos - When you mistype a function name in a module call, Keel now suggests similar function names from that module: (8f8c99c)
Lambda type inference for native stdlib functions - Lambda parameters can now be inferred when passed to native stdlib higher-order functions like map, filter, foldl, etc. No explicit type annotation needed: (e49ca6e)
Added first_param_type: Option<Type> field to NativeFunction struct
Higher-order stdlib functions (map, filter, foldl, foldr, zipWith, any, all, find, partition, sortBy) now carry type information
Type variables (Type::Var) are compatible with any concrete type during type checking
Native function types (Type::Native) are compatible with function types for type validation
Lazy stdlib registration - User modules can now shadow stdlib module names (List, String, Math, IO) if they don't import the stdlib version. Stdlib modules are registered lazily when imported rather than upfront, allowing code like: (e0ec85a)
ErrorHint for CompileError and TypeError - Comprehensive hint and note implementations for compile-time and type-checking errors (896bc9d)
CompileError::ErrorHint provides hints for variable, module, enum, pattern matching, or-pattern, and type errors
TypeError::ErrorHint provides hints for type mismatches, inference issues, function errors, and compound types
KeelError now delegates hint() and note() to inner CompileError and TypeError types
Examples: "Declare it with let x = ...", "All branches must return the same type", "Keel is strongly typed"
IO module security controls - File system IO disabled by default for security (066e13c) (cb5746c)
KEEL_IO_DISABLED=0|false: Enable file/directory IO (disabled by default)
KEEL_IO_READ_ONLY=1|true: Allow only read operations, block writes/deletes
KEEL_IO_SANDBOX=/path: Restrict all operations to a specific directory
Controls can be combined (e.g., KEEL_IO_DISABLED=0 KEEL_IO_SANDBOX=/tmp)
New error variants: IoDisabled, IoReadOnly, IoSandboxViolation, IoInvalidSandbox
Console operations (print, println, etc.) always allowed regardless of settings
Pure path operations (joinPath, parentDir, etc.) always allowed
Environment/process operations (getEnv, setEnv, getArgs, exit) not affected
Comprehensive parser documentation - All parser modules now have Rust doc comments following best practices (931a959)
Module-level //! docs with architecture tables and examples
Function-level /// docs with argument descriptions and usage notes
heap_get() and heap_get_mut() helper methods for accessing objects through HeapSlot
Comprehensive test suite (14 tests) covering GC behavior
SourceError struct for owned representation of parsing errors with span information (290545e)
List concatenation with ++ operator: [1, 2] ++ [3, 4] produces [1, 2, 3, 4] (c0fee09)
Dynamic register allocation: VM now pre-allocates exact number of registers needed based on bytecode.register_count set by compiler, replacing the hardcoded 64-register limit (2e4eeed)
~Changed
6 items
Renamed Run* error variants to ImportFile* — All file import compiler error variants now use the ImportFile prefix instead of Run (e.g., RunFileNotFound → ImportFileNotFound, CircularRunDependency → CircularImportDependency). Renamed compile_run.rs → compile_import_file.rs. (f2c63c8)
Inlined test constants - Replaced 227 single-use const TEST_EXPR_*: &str declarations across 33 test files with string literals at the call site, reducing indirection and removing ~300 lines (3f493f2)
Zero compiler warnings - Suppressed deprecated next_heap_index warning and removed unnecessary .clone() on usize (b028d62)
Clippy cleanup - Applied 444 auto-fixable clippy suggestions (redundant closures, unnecessary conversions, collapsible if-lets, redundant field names, etc.), reducing warnings from 494 to 50 (b028d62)
Suppressed test naming warnings - Added #[allow(non_snake_case)] to all generated test functions in the keel_test! macro, eliminating hundreds of double-underscore naming warnings (b028d62)