refactor: interpreter and type system improvements

- Parser and typechecker updates for new features
- Schema evolution refinements
- Type system enhancements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 03:54:23 -05:00
parent 634f665b1b
commit c6d7f5cffb
5 changed files with 400 additions and 64 deletions

View File

@@ -1343,6 +1343,16 @@ impl TypeEnv {
Type::List(Box::new(Type::var())),
),
),
(
"forEach".to_string(),
Type::function(
vec![
Type::List(Box::new(Type::var())),
Type::function(vec![Type::var()], Type::Unit),
],
Type::Unit,
),
),
]);
env.bind("List", TypeScheme::mono(list_module_type));
@@ -1410,6 +1420,14 @@ impl TypeEnv {
"fromChar".to_string(),
Type::function(vec![Type::Char], Type::String),
),
(
"parseInt".to_string(),
Type::function(vec![Type::String], Type::Option(Box::new(Type::Int))),
),
(
"parseFloat".to_string(),
Type::function(vec![Type::String], Type::Option(Box::new(Type::Float))),
),
]);
env.bind("String", TypeScheme::mono(string_module_type));