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

Formatter improvements #3194

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Formatter improvements #3194

wants to merge 5 commits into from

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Nov 27, 2024

  1. Closes Lambda functions miss the first pipe when formatted #3192. The first pipe is ensured in a multi-clause lambda.
  2. Bugfix: Pragmas are now properly printed for deriving statements. Previously they were never printed.
  3. Record types are always declared in a new line, even if they have a single constructor and fit in a line. I think this change improves readability.
    -- before
    type Eq A := mkEq@{builtin isEqual eq : A -> A -> Bool};
    
    -- after
    type Eq A :=
      mkEq@{
        builtin isEqual
        eq : A -> A -> Bool;
      };
    
  4. I've formatted the stdlib (Format juvix-stdlib#150).
  5. I've refactored some code related to adding the first pipe so that it is reused for cases, lambdas and types.
  6. Now ConstructorDef has a proper PrettyCode instance and does not need to be passed a bool indicating whether it is the only constructor in a definition.

@janmasrovira janmasrovira changed the title Refactor code to insert first pipe when missing Formatter improvements Nov 27, 2024
@janmasrovira janmasrovira marked this pull request as ready for review November 27, 2024 16:13
@paulcadman paulcadman added this to the 0.6.9 milestone Nov 27, 2024
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.

Lambda functions miss the first pipe when formatted
2 participants