5 ms·
I could not agree with you more! I use nix daily, and every time I go to edit it a nix file a voice in the back of my head says, "you should really start that H
by dtwhitney 9y ago
I could not agree with you more! I use nix daily, and every time I go to edit it a nix file a voice in the back of my head says, "you should really start that Haskell to Nix compiler you've been thinking about."
[edit] ha! just notice the next comment talking about hnix. Great minds... :)
- regnat 9y agoYou might be interested in dhall[0] and dhal-to-nix[1] which provides a really neat haskell-like language that compiles to nix. [0]: https://github.com/Gabriel439/Haskell-Dhall-Library https://github.com/Gabriel439/Haskell-Dhall-Library [1]: https://github.com/Gabriel439/Haskell-Dhall-Library https://github.com/Gabriel439/Haskell-Dhall-Library
- atemerev 9y agoIf only Haskellers knew that "a blog post" and "type definitions in Hackage" are not documentation... Also, the comma-first syntax like { foo = "bar" , baz = "qux" } drives me nuts. In the name of all good things in the world, why?
- radarsat1 9y ago> comma-first syntax oooh but this is one of those trivial things that I really liked in my brief days of using Haskell, and that has sometimes carried over to my C++, e.g. in initializer lists. I find it super useful because everything lines up nicely, and from the point of view of version control you don't have to edit the previous line to change '}' to ',' when adding a new line.
- coldtea 9y agoHow about allowing for bloody danging commas?
- wereHamster 9y agoIs there any real disadvantage to comma-first, other than aesthetics (which is entirely a personal preference)?
- Jweb_Guru 9y agoIt makes git diffs inaccurate compared to trailing commas.
- mbrock 9y agoHow so?
- viraptor 9y agoInserting a new element with comma-first changes 2 lines: - { old-one + { new-one + , old-one While trailing commas allow you to insert an element anywhere with just one line addition. This doesn't break anything, but it makes looking at "git blame" so much easier.
- dragonwriter 9y agoThis is only true if you insert at the head. And it's not really leading comma placement but the choice to put the first element in the line with the brace that is the culprit, though both are typical of comma-first.
- viraptor 9y agoWith separating comma, it either affects the first or the last position, depending on where you put the commas. But those are the most common places you modify lists.
- deleted 9y ago[deleted]
- 9y ago
- weberc2 9y agoGo solves this problem by permitting foo := Foo{ x: 10, y: 24, }
- ben0x539 9y agoWow, I'm doing the opposite where I'm staring at all these other DSLs and configuration files and have to hold myself back from writing a bunch of nix to autogenerate them from.
- nv-vn 9y agoHaha same here, I've been considering writing Nix expressions for window manager configurations for quite some time now, but some config files are so complex that it would take ages.