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

Allow omitting 'in' in chained bindings #662

Closed
wants to merge 1 commit into from

Conversation

vapourismo
Copy link

@vapourismo vapourismo commented Oct 28, 2018

Hi,

I want to make the language change as described below.
I am not sure whether I should propose this with dhall-lang or here.
Any help getting this through the proper channels is greatly appreciated.

Apologies if this has been brought up before, the GitHub search makes it awefully hard to search for let and in.


In my head this is a purely cosmetic change.
It should not change the validity of programs that are currently valid.

What was previously written as

   let l = λ(n : Natural) → λ(m : Natural) → λ(x : Natural) → n + m * x
in let f = l 2 3
in f 445

can now be written like

let l = λ(n : Natural) → λ(m : Natural) → λ(x : Natural) → n + m * x
let f = l 2 3
in
    f 445

This effectively makes in terminate a let-chain.

@Gabriella439
Copy link
Collaborator

@vapourismo: Changes to the language first go through a standardization process in this repository:

https://github.com/dhall-lang/dhall-lang/

... mainly because we're working on implementations in other languages.

The issue where this was most recently discussed is this one

dhall-lang/dhall-lang#226

The summary of that issue is I avoid introducing syntactic sugar unless it leads to significant code compression.

There was an additional point made in that issue about using records as a replacement, but that would not be relevant to your example since the definition of f depends on the definition of l so a record would not serve as a substitute.

@vapourismo
Copy link
Author

The removal of most ins and the redundant whitespace counts as significant code compression, especially in a language where let is the preferred way to bind things.
Moreover it cleans things up a little.

@Gabriella439
Copy link
Collaborator

I'll close this in favor of #675, which supersedes this change

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.

2 participants