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 diff command line mode #442

Merged
merged 2 commits into from
Jun 9, 2018
Merged

Conversation

basile-henry
Copy link
Collaborator

Issue #431

Add the command line Parser along with a basic implementation for the diff of two expressions after normalizing them. This reuses the existing mechanism to diff two dhall expressions and render a pretty diff

Add the command line Parser along with a basic implementation for the diff of two expressions after normalizing them. This reuses the existing mechanism to diff two dhall expressions and render a pretty diff

Signed-off-by: Basile Henry <bjm.henry@gmail.com>
expr <- throws (Dhall.Parser.exprFromText inputName exprRaw)
load expr

expression1 <- parseAndResolve "(expr1)" expr1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Dhall.inputExpr in place of parseAndResolve

The main difference is that inputExpr also type-checks the input, which is necessary to ensure that the expression is safe to normalize for diffing purposes

Signed-off-by: Basile Henry <bjm.henry@gmail.com>
@Gabriella439
Copy link
Collaborator

Awesome job! Thank you :)

@Gabriella439 Gabriella439 merged commit d181837 into dhall-lang:master Jun 9, 2018
@ocharles
Copy link
Member

ocharles commented Jun 9, 2018

Thanks, this is going to be really useful!

@basile-henry basile-henry deleted the dhall-diff branch June 9, 2018 08:07
@FintanH FintanH mentioned this pull request Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants