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:
2026-02-19 09:24:28 -05:00
parent 52dcc88051
commit ec365ebb3f
5 changed files with 149 additions and 1 deletions

View File

@@ -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,
},
],
},
);