feat: add File.copy and propagate effectful callback effects (WISH-7, WISH-14)
File.copy(source, dest) copies files via interpreter (std::fs::copy) and C backend (fread/fwrite). Effectful callbacks passed to higher-order functions like List.map/forEach now propagate their effects to the enclosing function's inferred effect set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -956,6 +956,14 @@ impl TypeEnv {
|
||||
params: vec![("path".to_string(), Type::String)],
|
||||
return_type: Type::Unit,
|
||||
},
|
||||
EffectOpDef {
|
||||
name: "copy".to_string(),
|
||||
params: vec![
|
||||
("source".to_string(), Type::String),
|
||||
("dest".to_string(), Type::String),
|
||||
],
|
||||
return_type: Type::Unit,
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user