
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1197 · main · 10 min 35 s
1Étoiles
0Forks
0Issues
Types: a partial application is a closure, sendable when what it holds is (#325)
A partial application's capture row was `<Local>` whenever arguments were
supplied, so `keep (greet prefix)` was refused where `keep fn n { greet
prefix n }` checked, with `keep :: f: send fn(String) -> String`. ADR 0062
left this as a conservative first cut.
A partial application holds its callee and the arguments it was given,
as its eta-expansion would. It is now registered as a `Closure` whose
captured values are those arguments' types (and the callee's, unless the
callee is a named function), with the partial's effect row as its effect.
`check_captures` decides it like a lambda: sent, everything it holds must
be `Send` (E0704 otherwise); not sent, it is `<Local>` when something may
not be `Send`, and stays sendable when all is. A callee whose row is
`<Local>` still makes it `<Local>` outright.
- `Closure.values`: the captured types that are not locals.
- tests/ui/currying.lse: sendable arguments, a field, a later send, a
`send fn` callee, a handler the callers supply; a plain `fn` argument
or callee is E0704.
- tests/run/send_partial_application.lse: another actor calls a partial
application sent in a message (interpreted and native).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Parents 4e5bf68
6 fichiers modifiés, 157 ajouts, 20 suppressions
crates/louise_types/src/infer/mod.rs+34−12crates/louise_types/src/lib.rs+7−4docs/adr/0062-parens-free-functions.md+8−4docs/reference/language.md+1−0tests/run/send_partial_application.lse+48−0tests/ui/currying.lse+59−0