tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Types, Core: a partial application takes its handlers as its eta-expansion would (#321)

ADR 0062 says a partial application's capabilities bind when its last
arrow applies; the checker and Core took them where it was written,
always. `run (logs q)`, with `run :: g: fn(Int) -> String / <log>`
installing the handler, was refused ("uses a different handler than
expected") while `run fn n { logs q n }` and `run (logs q _)` checked.

Under ADR 0010 the coherent rule is the lambda's: a partial application
takes its handlers as `fn x { f a x }` written in its place would.

- Types: a call checked against an arrow passes it to `call`. A partial
  application then binds the callee's capabilities that arrow's callers
  supply (as `def_value` does for a name used as a value) and records
  which in `CapSites::partials`.
- Core: the closure receives those after its captures (`CapSource`),
  for a function, an operation and a function value; the others are
  captured where it is written, as before.
- Stored in a `let`, it still uses the handlers in scope where it is
  written: one made outside a `handle` and used inside is E0703, as a
  lambda's is (tests/ui/currying.lse).
- ADR 0062 says so in Currying, the row rule, installers and the notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 4 sem. · 5b71efdbd75a6c07e1438b3fa29faa7bc124420a

Parents 50d6b07

6 fichiers modifiés, 331 ajouts, 72 suppressions