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:
18
src/types.rs
18
src/types.rs
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user