Re: Permitting trailing commas for record syntax ADT declarations
Hello, My 2c: I don't think that supporting trailing commas is worth the additional complexity to the compiler and the language. I work with Haskell on a daily basis, and I honestly don't think that this is going to simplify my job in any way. On the other hand, it seems like it it will make it more complex to write tools that process Haskell, and to explain the syntax of the language to beginners. -Iavor On Wed, Sep 24, 2014 at 12:38 PM, Alexander Berntsen alexan...@plaimi.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 24/09/14 08:50, Edward Kmett wrote: I'm personally of the it should be a language extension like everything else mindset Yeah, I'm going the Pragma route. If we limit it to record-like notions, and import/export lists, then we don't have to deal with conflicts with TupleSections and while it is inconsistent to have tuples behave differently, than other comma-separated lists, I'd really rather retain tuple sections, which I use somewhat heavily, than lose them to mindless uniformity over how we handle comma-separated lists. I'm implementing it for things where I 100% subjectively feel it makes sense. This does *not* include tuples, for the reason you mention. When I get the time, I will make a Wiki page outlining what I'm changing and my motivation for doing it. We can then have a discussion about where to draw the line. I need to figure out a more elegant solution than tweaking the parser for each individual item. If someone knows their way around this code, please talk to me on IRC/SIP/XMPP/whatever. Just email me for contact info. I'll be busy today with a haskell workshop, but I plan on spending the rest of the week on this business. - -- Alexander alexan...@plaimi.net https://secure.plaimi.net/~alexander -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQinw4ACgkQRtClrXBQc7VL4gD6Ao12HqH1Mjl30n/1Mwlby7W6 /2+JeUOF9ui959xh1QkBAIdTA6km9gDvgCQ1nBQ5juZFNF79C1Fezk2yEpOvF7Fe =l/sh -END PGP SIGNATURE- ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
Ah, just look at all these brace-and-semicolon languages, and how they thrive, and how many beginners have mastered them... #include stdio.h int main () { ; /* It is sunny today, so I am in the mood for a leading semi. */ ; /* Still not in the mood to start work. */ int i; ; for (i=0; i 5; i++) { printf(%d, i); }; /* Mmh, do you need to put a semi after the closing brace? */ /* Let's put one, just to be sure. */ /* TODO: more code */; } import Data.Foldable (forM_) main = do { ; -- It is sunny today, so I am in the mood for a leading semi. ; -- Still not in the mood to start work. ; forM_ [0..4] $ \ i - do { print i ;} ;} -- Mmh, do you need to put a semi befor the closing brace? -- Let's put one, just to be sure. On 25.09.2014 09:13, Iavor Diatchki wrote: Hello, My 2c: I don't think that supporting trailing commas is worth the additional complexity to the compiler and the language. I work with Haskell on a daily basis, and I honestly don't think that this is going to simplify my job in any way. On the other hand, it seems like it it will make it more complex to write tools that process Haskell, and to explain the syntax of the language to beginners. -Iavor On Wed, Sep 24, 2014 at 12:38 PM, Alexander Berntsen alexan...@plaimi.net mailto:alexan...@plaimi.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 24/09/14 08:50, Edward Kmett wrote: I'm personally of the it should be a language extension like everything else mindset Yeah, I'm going the Pragma route. If we limit it to record-like notions, and import/export lists, then we don't have to deal with conflicts with TupleSections and while it is inconsistent to have tuples behave differently, than other comma-separated lists, I'd really rather retain tuple sections, which I use somewhat heavily, than lose them to mindless uniformity over how we handle comma-separated lists. I'm implementing it for things where I 100% subjectively feel it makes sense. This does *not* include tuples, for the reason you mention. When I get the time, I will make a Wiki page outlining what I'm changing and my motivation for doing it. We can then have a discussion about where to draw the line. I need to figure out a more elegant solution than tweaking the parser for each individual item. If someone knows their way around this code, please talk to me on IRC/SIP/XMPP/whatever. Just email me for contact info. I'll be busy today with a haskell workshop, but I plan on spending the rest of the week on this business. - -- Alexander alexan...@plaimi.net mailto:alexan...@plaimi.net https://secure.plaimi.net/~alexander -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQinw4ACgkQRtClrXBQc7VL4gD6Ao12HqH1Mjl30n/1Mwlby7W6 /2+JeUOF9ui959xh1QkBAIdTA6km9gDvgCQ1nBQ5juZFNF79C1Fezk2yEpOvF7Fe =l/sh -END PGP SIGNATURE- ___ ghc-devs mailing list ghc-devs@haskell.org mailto:ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs -- Andreas AbelDu bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.a...@gu.se http://www2.tcs.ifi.lmu.de/~abel/ ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 25/09/14 09:13, Iavor Diatchki wrote: I work with Haskell on a daily basis, and I honestly don't think that this is going to simplify my job in any way. I too work with Haskell every day, and I *know* this will make my job easier. On the other hand, it seems like it it will make it more complex to write tools that process Haskell, and to explain the syntax of the language to beginners. Not sure how it will make tools more complicated as a pragma. they can always just not support the pragma if it's that hard. - -- Alexander alexan...@plaimi.net https://secure.plaimi.net/~alexander -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQjzfcACgkQRtClrXBQc7WO8wEAndhjRsCkVXp2mJWSW1steQYT 1C9P6pzzntViDQS9tHsA/09GSKO0lHlmU1B5PWKkGkNmiCFV8hJUzTEYAo1363E8 =0Db/ -END PGP SIGNATURE- ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
How to build the user guide?
Is there a way to build the user guide without having to build everything? The wiki [1] suggests cd docs/users_guide make html stage=0 FAST=YES but that doesn't seem to work. Janek [1] https://ghc.haskell.org/trac/ghc/wiki/Building/Docs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
I agree with Iavor on this one. I use Haskell professionally as well, and I'm actually quite fond of what it leaves out in terms of both syntax and semantics, as opposed to what it adds. Whether it's pragma protected or not, I just don't see the point of complicating the language with such a seemingly minor feature. Also, as pointed out before, the tuple-sections feature interact badly with this, and the treatment of commas in lists and tuples being different is a source of concern. If it's added, however, it should definitely be pragma protected as I'm pretty sure if I ever have extra commas lying around it's because I inadvertently deleted something or made some other cut-paste error. I'd like GHC to keep telling me about those in perpetuity. -Levent. On Thu, Sep 25, 2014 at 1:10 AM, Alexander Berntsen alexan...@plaimi.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 25/09/14 09:13, Iavor Diatchki wrote: I work with Haskell on a daily basis, and I honestly don't think that this is going to simplify my job in any way. I too work with Haskell every day, and I *know* this will make my job easier. On the other hand, it seems like it it will make it more complex to write tools that process Haskell, and to explain the syntax of the language to beginners. Not sure how it will make tools more complicated as a pragma. they can always just not support the pragma if it's that hard. - -- Alexander alexan...@plaimi.net https://secure.plaimi.net/~alexander -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQjzfcACgkQRtClrXBQc7WO8wEAndhjRsCkVXp2mJWSW1steQYT 1C9P6pzzntViDQS9tHsA/09GSKO0lHlmU1B5PWKkGkNmiCFV8hJUzTEYAo1363E8 =0Db/ -END PGP SIGNATURE- ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
The reason to support trailing commas are entirely related to engineering and not language expressiveness. Having trailing commas means that diff tools and version control systems work better. This is why most languages support them. ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 25/09/14 11:18, Simon Peyton Jones wrote: · If we have it at all, ExtraCommas should be a {-# LANGUAGE ExtraCommas #-} extension, like any other. · ExtraCommas should leave tuples alone (always) OK? These are the core principles of I'm working with/towards. When I have it satisfactory working, and have made up my mind about the details, I will make a Wiki article explaining it all. Thanks to everyone who's voiced their opinion and given me suggestions. - -- Alexander alexan...@plaimi.net https://secure.plaimi.net/~alexander -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQj3yMACgkQRtClrXBQc7W0lQD9HmCg7dAbT6vP7iKOvYVY/RuQ SM2vetxcRizC+SjhCUoA/A8IaY4PNZqnGTEl42ptX2hPOdx07E2WrSE1T9Kq3TBo =YqQ2 -END PGP SIGNATURE- ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: How to build the user guide?
Maybe try BUILD_DOCBOOK_HTML=YES Edward Excerpts from Jan Stolarek's message of 2014-09-25 01:26:35 -0700: Is there a way to build the user guide without having to build everything? The wiki [1] suggests cd docs/users_guide make html stage=0 FAST=YES but that doesn't seem to work. Janek [1] https://ghc.haskell.org/trac/ghc/wiki/Building/Docs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
Sounds good to me. On Thu, Sep 25, 2014 at 11:18 AM, Simon Peyton Jones simo...@microsoft.com wrote: There’s a danger of disappearing into a bikeshed here. I think it’s clear that: · If we have it at all, ExtraCommas should be a {-# LANGUAGE ExtraCommas #-} extension, like any other. · ExtraCommas should leave tuples alone (always) Provided there is that LANGUAGE extension, I have no objection to having it in GHC if Alexander wants to implement it. It has low impact, and some people like it a lot. People who don’t like it don’t have to switch on the extension. It’s unclear whether extra commas in literal lists [a,,b,,] should behave like TupleSections or like ExtraCommas. My instinct is the former, because the only difference is round vs square parens.That would suggest continuing to make extra commas illegal in literal lists, for now anyway. That’s a conservative choice, which is usually the side to err on when it’s a toss-up. OK? Simon *From:* Iavor Diatchki [mailto:iavor.diatc...@gmail.com] *Sent:* 25 September 2014 08:14 *To:* Alexander Berntsen *Cc:* Edward Kmett; Simon Peyton Jones; ghc-devs@haskell.org *Subject:* Re: Permitting trailing commas for record syntax ADT declarations Hello, My 2c: I don't think that supporting trailing commas is worth the additional complexity to the compiler and the language. I work with Haskell on a daily basis, and I honestly don't think that this is going to simplify my job in any way. On the other hand, it seems like it it will make it more complex to write tools that process Haskell, and to explain the syntax of the language to beginners. -Iavor On Wed, Sep 24, 2014 at 12:38 PM, Alexander Berntsen alexan...@plaimi.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 24/09/14 08:50, Edward Kmett wrote: I'm personally of the it should be a language extension like everything else mindset Yeah, I'm going the Pragma route. If we limit it to record-like notions, and import/export lists, then we don't have to deal with conflicts with TupleSections and while it is inconsistent to have tuples behave differently, than other comma-separated lists, I'd really rather retain tuple sections, which I use somewhat heavily, than lose them to mindless uniformity over how we handle comma-separated lists. I'm implementing it for things where I 100% subjectively feel it makes sense. This does *not* include tuples, for the reason you mention. When I get the time, I will make a Wiki page outlining what I'm changing and my motivation for doing it. We can then have a discussion about where to draw the line. I need to figure out a more elegant solution than tweaking the parser for each individual item. If someone knows their way around this code, please talk to me on IRC/SIP/XMPP/whatever. Just email me for contact info. I'll be busy today with a haskell workshop, but I plan on spending the rest of the week on this business. - -- Alexander alexan...@plaimi.net https://secure.plaimi.net/~alexander -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQinw4ACgkQRtClrXBQc7VL4gD6Ao12HqH1Mjl30n/1Mwlby7W6 /2+JeUOF9ui959xh1QkBAIdTA6km9gDvgCQ1nBQ5juZFNF79C1Fezk2yEpOvF7Fe =l/sh -END PGP SIGNATURE- ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
On 2014-09-25 at 11:18:01 +0200, Simon Peyton Jones wrote: That would suggest continuing to make extra commas illegal in literal lists, for now anyway. That’s a conservative choice, which is usually the side to err on when it’s a toss-up. I'd just like to point out, that lists are something that you may want to tweak regularily in code (while tuple are rather fixed-size entities whose size is extended less frequently) Consider the following JSON example: foo = object [ key1 .= True, key2 .= 123, key3 .= (), ] This is code where I often tend to add/remove lines, and ExtraCommas would greatly reduce the diff-noise, and which I really miss from languages such as Python which allow me to use trailing commas. ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: Permitting trailing commas for record syntax ADT declarations
On Thu, Sep 25, 2014 at 12:03:13PM +0200, Herbert Valerio Riedel wrote: I'd just like to point out, that lists are something that you may want to tweak regularily in code (while tuple are rather fixed-size entities whose size is extended less frequently) Consider the following JSON example: foo = object [ key1 .= True, key2 .= 123, key3 .= (), ] This is code where I often tend to add/remove lines, and ExtraCommas would greatly reduce the diff-noise, and which I really miss from languages such as Python which allow me to use trailing commas. One compromise could be, that additional commatas in literal lists are only allowed at the beginning and at the end. Then your use case would work and also something like: abc = [ -- a , a -- b , b -- c , c ] I think that are the main uses of additional commatas in literal lists and I can't see that someone really wants a list literal like '[,3,,4,]', so wrongly reading it as a list section shouldn't be an issue. Greetings, Daniel ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs