News for hackers. Stuff that matters.
Re:Why are we templating YAML? by svnpenn on Thursday February 07, 2019 @05:48PM (#19109443)
god those examples are ugly - commas at the beginning of a line? mismatched brace styles?
Re:Why are we templating YAML? by chriswarbo on Thursday February 07, 2019 @07:33PM (#19110146)
Not sure what you mean by "mismatched brace styles". The convention of putting separators like commas at the start of the following line rather than the end of the preceding line is common in Haskell, which Dhall is built with.

The advantages are:

- All of the separators are in the same column, along with the opening and closing characters. This makes it trivial to check if we've missed a separator.

- Appending new lines to the end will not affect previous lines (i.e. we don't need to go and add a comma). This avoids making mistakes and polluting diffs.

Unfortunately the error-prone diff pollution we avoid at the last line instead occurs at the first line. It's still less error-prone than trailing commas, since we can look in the separator column and either spot that it's empty, or that it contains two opening braces (depending on whether we inserted or copy/pasted).

Re:Why are we templating YAML? by necubi on Thursday February 07, 2019 @07:22PM (#19110073)
It's a haskell thing. The main advantage is that each line is independent. You can comment out a line or add a line at the end without modifying anything else.
Re:Why are we templating YAML? by basil-rash on Thursday February 07, 2019 @09:40PM (#19111020)
Each line is not independent: you cannot comment out the first line. A better approach is to allow trailing commas. (I suppose you could allow leading commas, does Haskell support this?)
Re:Why are we templating YAML? by nh2 on Friday February 08, 2019 @12:35AM (#19111805)
Unfortunately no.

Allowing trailing commas, like Python does, would be really great. Unfortunately trailing commas already mean something: (a,b,) is a function that still takes 1 argument to make a triple. It's called "TupleSections".