Skip to content

Commit

Permalink
Pros and cons about keeping "match" in primitive records or not
Browse files Browse the repository at this point in the history
  • Loading branch information
herbelin committed Sep 6, 2021
1 parent c22bf79 commit 061edd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion text/primitive-projections.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ See associated [Zulip discussion](https://coq.zulipchat.com/#narrow/stream/23765

## Issue 3: the status of `match` and destructing `let` in "primitive" record types

See impact of desugaring `match` in terms of complexity ([#13913](https://github.com/coq/coq/pull/13913)) or unification ([#6726](https://github.com/coq/coq/issues/6726), [9763](https://github.com/coq/coq/issues/9763)) or readability ([6723](https://github.com/coq/coq/issues/6723)).
See impact of desugaring `match` in terms of complexity ([#13913](https://github.com/coq/coq/pull/13913)) or unification ([#6726](https://github.com/coq/coq/issues/6726), [#9763](https://github.com/coq/coq/issues/9763)) or readability ([#6723](https://github.com/coq/coq/issues/6723)).

*Design choice 1*: keep `match` nodes as they are in primitive record types; they will behave correctly for reduction (that is like their expansion into projections); to deal with them in the conversion, it is enough to extend the conversion with eta-expansions of `match` into projections.

- Advantages: a priori no break of compatibility for the developments already using `match` on primitive record types

*Design choice 2*: forbid `match` at all on primitive record types (as well as `fun 'pat => ...` and `let 'pat := ... in ...` and `let (x1,...,xn) := ... in ...`), even as a primitive form of sugar, making primitive and non-primitive record types two incompatible styles of formalization.

- Advantages: model consistent with viewing primitive record types as negative types in polarized logic
- Drawbacks: unclear how to address the compatibility with existing code

## Issue 4: The status of the `t.(f args)` notation as an alternative notation for any kind of application.

See e.g. [#11332](https://github.com/coq/coq/pull/11332).
Expand Down

0 comments on commit 061edd8

Please sign in to comment.