tobogganSe connecter

packages

The Louise packages, each released on its own

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

Types: currying, labels in the type, `fn() -> T` is `fn(()) -> T` (ADR 0061, issue #314)

Phase 2: HIR and the type checker.

- HIR: parameters carry labels (`Param.label`, `LambdaParam.label`,
  `FnParamRef.label`); the `~name` pun binds `name`; a call records
  whether its argument list kept parentheses (construction); a piped
  constructor stays construction (`x |> Some` is `Some(x)`); a `~` label
  on a constructor's fields or a parenthesised function call is E0125 at
  lowering; a bare `:` label in an application's arguments does not parse.
- Types: `Ty::Fn` parameters are `FnParam { label, ty }`; curried chains
  flatten at HIR type lowering (`fn(a) -> fn(b) -> c / <e>` is
  `fn(a, b) -> c / <e>`, the row on the last arrow; a parenthesised
  return is a returned closure; `send fn` stops a chain); `fn() -> T` is
  `fn(()) -> T` — the unit argument is real, so `f ()` calls a
  zero-parameter `fn f ::`. Unification wants equal labels per position;
  the printer writes the `fn(a, ~b: B) -> c / <e>` sugar, and `fn()` for
  the unit parameter.
- Application is the binary rule made incremental: per-atom placement
  (a labelled atom takes its named parameter wherever it stands, an
  unlabelled one the first unlabelled parameter left), descending into
  the result's own arrow when arguments outlast it; too few is not an
  error — the remainder is the partial application's type; too many is
  E0205 ("the function is fully applied"). `order_args`'s slot-filling
  stays for constructors (construction is n-ary: all fields, labels or
  position) and Core's placement; issue #161's machinery retires for
  functions. Effects perform when an arrow completes; capabilities and
  dictionaries are taken at the first application, as today. A partial
  application's capture row is the callee's, or `<Local>` when arguments
  were supplied (conservative; the send-fn refinement is open for
  review).
- Constructors: `User a b` is E0216 (construction is not application);
  `User("ada")` with fields missing is E0205 (no partial construction).
- Trait/impl: labels are part of the contract; the unit parameter
  matches a zero-parameter method; handler clauses the same.
- The whole migrated repository typechecks (`louise check std/`,
  examples, packages, tests); the UI suite is re-blessed, with new tests
  for partial application, labels by name out of order, and currying
  through pipes (tests/ui/currying.lse); tests/ui/signatures.lse's
  label section is rewritten for declared labels.

Not yet green: tests/run and the louise integration tests run programs
— they wait on phase 3 (Core's partial application and the unit
argument at the ABI).

olivier · il y a 4 sem. · aca90ef3e87dcd8df919878f02b2a03df70a5b62

Parents df071da

24 fichiers modifiés, 2931 ajouts, 2869 suppressions

Mpostgres/test/protocol_test.lse+102−115
Mpostgres/test/template_test.lse+11−11