Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add record declaration syntax #2254

Merged
merged 7 commits into from
Jul 24, 2023

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Jul 17, 2023

This pr adds the option to declare constructors with fields. E.g.

type Pair (A B : Type) :=
  | mkPair {
      fst : A;
      snd : B
    };

Which is desugared to

type Pair (A B : Type) :=
  | mkPair :  (fst : A) -> (snd : B) -> Pair A B;

making it possible to write mkPair (fst := 1; snd := 2).

Mutli-constructor types are also allowed to have fields.

@janmasrovira janmasrovira added this to the 0.5 milestone Jul 17, 2023
@janmasrovira janmasrovira self-assigned this Jul 17, 2023
@janmasrovira janmasrovira linked an issue Jul 17, 2023 that may be closed by this pull request
@janmasrovira janmasrovira force-pushed the 1641-add-record-declaration-syntax-support branch 4 times, most recently from a3a0c3b to 868bde7 Compare July 19, 2023 13:48
@janmasrovira janmasrovira force-pushed the 1641-add-record-declaration-syntax-support branch from 868bde7 to c8a5f25 Compare July 19, 2023 15:00
@janmasrovira janmasrovira requested a review from paulcadman July 19, 2023 15:03
@janmasrovira janmasrovira marked this pull request as ready for review July 19, 2023 15:03
@jonaprieto jonaprieto requested review from lukaszcz and removed request for paulcadman July 24, 2023 10:51
@lukaszcz lukaszcz merged commit e79159b into main Jul 24, 2023
@lukaszcz lukaszcz deleted the 1641-add-record-declaration-syntax-support branch July 24, 2023 14:56
@lukaszcz lukaszcz modified the milestones: 0.5 , 0.4.3 Jul 24, 2023
@jonaprieto jonaprieto modified the milestones: 0.4.3, 0.4.2 Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add record declaration syntax support
3 participants