Navigation Menu

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 dhall --type option. #349

Closed
sellout opened this issue Apr 4, 2018 · 3 comments · Fixed by #352
Closed

Add dhall --type option. #349

sellout opened this issue Apr 4, 2018 · 3 comments · Fixed by #352

Comments

@sellout
Copy link
Collaborator

sellout commented Apr 4, 2018

In psibi/dhall-mode#7, I’ve made it possible to display the type of the file in the header line in Emacs. Currently I do

dhall --plain <<< $file 2>&1 >/dev/null

to capture the type, but I think that also does a bunch of other normalization work that I’m throwing away. It’d be great if it were possible to only do what’s necessary to get the type out, and to make it a bit less complicated to do so – ideally outputting the type on stdout, and the errors remaining on stderr.

@Gabriella439
Copy link
Collaborator

Yeah, I've been meaning to add optional sub-commands to Dhall to capture individual phases of the pipeline (i.e. dhall type, dhall normalize, dhall resolve, etc.). I'll take a stab at this

@Gabriella439
Copy link
Collaborator

There is one subtlety here: splitting out each phase of the interpreter into a separate subcommand would mean that you would need to do:

dhall resolve | dhall type

... if you want to get both import resolution and type-checking

@sellout
Copy link
Collaborator Author

sellout commented Apr 7, 2018

For my own use case, I’m fine with that, as I want to basically show a one-line “sketch” of the type while editing, so avoiding resolution and normalization can often help with that.

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 a pull request may close this issue.

2 participants