<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I'm happy with this. Thanks!<div class=""><br class=""></div><div class="">Richard<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 19, 2021, at 9:25 AM, Eric Seidel <<a href="mailto:eric@seidel.io" class="">eric@seidel.io</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Dear Committee,</span><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Simon PJ has requested (on GitHub) that we merge all aspects of this proposal into a single extension NamedDefaults. We already had agreement that the import behavior should not be guarded by any extension, so I take this to mean the following. </div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">The proposal will introduce a single new extension NamedDefaults that enables:</div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">1. The ‘default C (T1, T2, …)’ syntax that specifies the defaulted class. </div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">2. Exporting defaulting rules as discussed (explicitly, in the export list). </div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Defaulting rules are always imported (implicitly), with no need to enable the NamedDefaults extension. </div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Any objections?<br class=""><br class=""><div dir="ltr" class="">Sent from my iPhone</div><div dir="ltr" class=""><br class=""><blockquote type="cite" class="">On Aug 14, 2021, at 12:58, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" class="">simonpj@microsoft.com</a>> wrote:<br class=""><br class=""></blockquote></div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Eric<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">I’m in support too – but I have added three small qns to the GitHub thread.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><br class="">Simon<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0cm 0cm 0cm 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span lang="EN-US" class="">From:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space"> </span>ghc-steering-committee <<a href="mailto:ghc-steering-committee-bounces@haskell.org" class="">ghc-steering-committee-bounces@haskell.org</a>><span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Spiwack, Arnaud<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>05 August 2021 07:43<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Eric Seidel <<a href="mailto:eric@seidel.io" class="">eric@seidel.io</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:ghc-steering-committee@haskell.org" class="">ghc-steering-committee@haskell.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [ghc-steering-committee] #409: Exportable named defaults, Recommendation: Accept<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 11pt; font-family: Calibri, sans-serif;">I'm very supportive of this proposal. Thanks to everyone who participated in the discussion. Like Eric, I don't see any value to the ImportedDefault extension, and would rather we removed it.<o:p class=""></o:p></p></div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p class=""> </o:p></p><div class=""><div class=""><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 11pt; font-family: Calibri, sans-serif;">On Tue, Aug 3, 2021 at 4:10 AM Eric Seidel <<a href="mailto:eric@seidel.io" style="color: blue; text-decoration: underline;" class="">eric@seidel.io</a>> wrote:<o:p class=""></o:p></p></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;" class=""><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 11pt; font-family: Calibri, sans-serif;">Committee,<br class=""><br class="">Mario has updated the proposal following some discussion on GitHub around the question of implicit vs explicit export and import of default rules. The result is<br class=""><br class="">1. *Implicit import*: any and all forms of `import M` also import any defaulting rules exported by M, like type classes.<br class=""><br class="">2. *Explicit export*: defaulting rules must be explicitly exported like named things, mostly. The one exception is that<span class="Apple-converted-space"> </span><br class=""><br class="">    module M (module N) where { import N }<br class=""><br class="">does not re-export any defaulting rules imported from N. Simon PJ argued strongly for this change on GitHub[1].<br class=""><br class="">With that question settled, and with Simon and Richard's assent on GitHub, *I'd like to recommend that we accept the proposal*. However, I still do not see the need for a separate ImportedDefaults extension and would recommend that we enable the import behavior universally.<br class=""><br class="">[1]:<span class="Apple-converted-space"> </span><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fghc-proposals%2Fghc-proposals%2Fpull%2F409%23issuecomment-882338794&data=04%7C01%7Csimonpj%40microsoft.com%7C4209473397bb4a1e123d08d957dc5f41%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637637426303882159%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QimksAfoQFVo25E0UgtDwLiOUFKzUgl24h5P%2BvO26Oc%3D&reserved=0" target="_blank" style="color: blue; text-decoration: underline;" class="">https://github.com/ghc-proposals/ghc-proposals/pull/409#issuecomment-882338794</a><br class=""><br class="">On Mon, Jul 12, 2021, at 04:09, Simon Peyton Jones wrote:<br class="">> <span class="Apple-converted-space"> </span><br class="">> I have added this as a comment in the GitHub repo, since others may<span class="Apple-converted-space"> </span><br class="">> want to express an opinion<br class="">> <span class="Apple-converted-space"> </span><br class="">> Simon<br class="">> <span class="Apple-converted-space"> </span><br class="">> *From:* ghc-steering-committee<span class="Apple-converted-space"> </span><br class="">> <<a href="mailto:ghc-steering-committee-bounces@haskell.org" target="_blank" style="color: blue; text-decoration: underline;" class="">ghc-steering-committee-bounces@haskell.org</a>> *On Behalf Of *Richard<span class="Apple-converted-space"> </span><br class="">> Eisenberg<br class="">> *Sent:* 11 July 2021 02:48<br class="">> *To:* Eric Seidel <<a href="mailto:eric@seidel.io" target="_blank" style="color: blue; text-decoration: underline;" class="">eric@seidel.io</a>><br class="">> *Cc:*<span class="Apple-converted-space"> </span><a href="mailto:ghc-steering-committee@haskell.org" target="_blank" style="color: blue; text-decoration: underline;" class="">ghc-steering-committee@haskell.org</a><br class="">> *Subject:* Re: [ghc-steering-committee] #409: Exportable named<span class="Apple-converted-space"> </span><br class="">> defaults, Recommendation: Partial Accept<br class="">> <span class="Apple-converted-space"> </span><br class="">> <span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> > On Jul 9, 2021, at 12:35 AM, Eric Seidel <<a href="mailto:eric@seidel.io" target="_blank" style="color: blue; text-decoration: underline;" class="">eric@seidel.io</a>> wrote:<br class="">> > <span class="Apple-converted-space"> </span><br class="">> > On Thu, Jul 1, 2021, at 13:16, Joachim Breitner wrote:<br class="">> ><span class="Apple-converted-space"> </span><br class="">> >> a different way to phrase that question might be: Do we want these<br class="">> >> defaulting declarations to behave just exactly like named things, or<br class="">> >> exactly like typeclass instances, or do we afford a new class with it’s<br class="">> >> own exporting/importing behavior. Is that a fair assessment?<br class="">> ><span class="Apple-converted-space"> </span><br class="">> > Not entirely, I think.<span class="Apple-converted-space"> </span><br class="">> ><span class="Apple-converted-space"> </span><br class="">> > We currently have two types of import/export behavior:<br class="">> > named things, and typeclass instances. The proposal as currently<br class="">> > written places defaulting rules somewhere in between: defaulting<br class="">> > rules are exported like named things, but imported like class instances.<br class="">> > This is new, but not too foreign, as the behavior on both sides exactly<br class="">> > matches existing behavior we're familiar with. It's just the combination<br class="">> > that's new.<br class="">> <span class="Apple-converted-space"> </span><br class="">> This doesn't match my understanding of the proposal. It looks to me<span class="Apple-converted-space"> </span><br class="">> that, as written in the proposal, exports of a `default` would have to<span class="Apple-converted-space"> </span><br class="">> be explicit. That is, a module starting with `module M where ...` would<span class="Apple-converted-space"> </span><br class="">> not export any defaults. This fact is a bit implied in the proposal<span class="Apple-converted-space"> </span><br class="">> ("This proposal does not modify that behaviour: a `default` declaration<span class="Apple-converted-space"> </span><br class="">> by itself does not apply outside its module."), but it's my best<span class="Apple-converted-space"> </span><br class="">> understanding.<span class="Apple-converted-space"> </span><br class="">> <span class="Apple-converted-space"> </span><br class="">> ---<br class="">> <span class="Apple-converted-space"> </span><br class="">> Simon and I have discussed. We both came to an agreement that imports<span class="Apple-converted-space"> </span><br class="">> should have to be explicit.<br class="">> <span class="Apple-converted-space"> </span><br class="">> GHC currently has two import/export strategies.<br class="">> <span class="Apple-converted-space"> </span><br class="">> Strategy 1: Always. In the Always strategy, an entity is always<span class="Apple-converted-space"> </span><br class="">> exported from a module and always brought into scope from an imported<span class="Apple-converted-space"> </span><br class="">> module. The Always strategy is used for type and class instances.<br class="">> <span class="Apple-converted-space"> </span><br class="">> Strategy 2: Public. In the Public strategy, an entity is exported by<span class="Apple-converted-space"> </span><br class="">> default (no export list) or when explicitly included in an export list.<span class="Apple-converted-space"> </span><br class="">> It is brought into scope from an importing module by default (no import<span class="Apple-converted-space"> </span><br class="">> list) or when explicitly included in an import list. A Public entity<span class="Apple-converted-space"> </span><br class="">> may be excluded from scope by a `hiding` clause. All top-level named<span class="Apple-converted-space"> </span><br class="">> entities are exported/imported via the Public strategy.<br class="">> <span class="Apple-converted-space"> </span><br class="">> I propose (with Simon's support)<br class="">> <span class="Apple-converted-space"> </span><br class="">> Strategy 3: Private. In the Private strategy. an entity is exported<span class="Apple-converted-space"> </span><br class="">> only when explicitly included in an export list, and it is brought into<span class="Apple-converted-space"> </span><br class="">> scope from an imported module only when explicitly included in the<span class="Apple-converted-space"> </span><br class="">> import list. I propose we use Private for `default` declarations (only).<br class="">> <span class="Apple-converted-space"> </span><br class="">> Reasons:<br class="">> <span class="Apple-converted-space"> </span><br class="">> * Changing defaulting behavior really can launch the rockets. Suppose T<span class="Apple-converted-space"> </span><br class="">> has a Num instance whose fromInteger uses unsafePerformIO to launch the<span class="Apple-converted-space"> </span><br class="">> rockets. Then including T in an import list could make a very<span class="Apple-converted-space"> </span><br class="">> innocent-looking `x = 5` declaration launch the rockets.<br class="">> <span class="Apple-converted-space"> </span><br class="">> * GHC currently supports an option -ddump-minimal-imports, which<span class="Apple-converted-space"> </span><br class="">> displays import lists describing what symbols must be brought into<span class="Apple-converted-space"> </span><br class="">> scope from an imported module. If a `import M` import statement brought<span class="Apple-converted-space"> </span><br class="">> defaulting behavior into scope, then going from `import M` to `import M<span class="Apple-converted-space"> </span><br class="">> (foo, bar)` might deleteriously change defaulting behavior, thus<span class="Apple-converted-space"> </span><br class="">> invalidating the work of -ddump-minimal-imports.<br class="">> <span class="Apple-converted-space"> </span><br class="">> * The proposal as written does not describe how `module` exports work<span class="Apple-converted-space"> </span><br class="">> with named defaults. For example, what happens in `module B (module A)<span class="Apple-converted-space"> </span><br class="">> where import A`? Normally, that re-exports all names in scope both as<span class="Apple-converted-space"> </span><br class="">> `A.blah` and as `blah`. But, of course, a default isn't named in this<span class="Apple-converted-space"> </span><br class="">> way. So is the default exported? By requiring explicit inclusion in the<span class="Apple-converted-space"> </span><br class="">> export list, the Private strategy sidesteps this question.<br class="">> <span class="Apple-converted-space"> </span><br class="">> * This is a more conservative choice. We can always revisit this in the<span class="Apple-converted-space"> </span><br class="">> light of experience. However, if defaults were always imported, it<span class="Apple-converted-space"> </span><br class="">> would be much more disruptive to make them imported only by request.<br class="">> <span class="Apple-converted-space"> </span><br class="">> We have rightly identified that using the Private strategy would<span class="Apple-converted-space"> </span><br class="">> potentially reduce the usefulness of this idea, especially with<span class="Apple-converted-space"> </span><br class="">> alternative Preludes. As far as I know, GHC does not currently<span class="Apple-converted-space"> </span><br class="">> officially support having an alternative Prelude. That is, an<span class="Apple-converted-space"> </span><br class="">> "alternative Prelude" is really just disabling the import of<span class="Apple-converted-space"> </span><br class="">> base.Prelude and then importing some other module. However, we could<span class="Apple-converted-space"> </span><br class="">> imagine a compiler flag that specifies another package (or module name)<span class="Apple-converted-space"> </span><br class="">> to use as the Prelude... and then we could also specify how it is<span class="Apple-converted-space"> </span><br class="">> imported. For example, we could say that the Prelude is imported with<br class="">> <span class="Apple-converted-space"> </span><br class="">> > import Prelude<br class="">> > import Prelude ( default(..) )<br class="">> <span class="Apple-converted-space"> </span><br class="">> where the second line says to grab all the defaults. I think this would<span class="Apple-converted-space"> </span><br class="">> be reasonable, but not necessary in the first version of this current<span class="Apple-converted-space"> </span><br class="">> proposal.<br class="">> <span class="Apple-converted-space"> </span><br class="">> Richard<br class="">_______________________________________________<br class="">ghc-steering-committee mailing list<br class=""><a href="mailto:ghc-steering-committee@haskell.org" target="_blank" style="color: blue; text-decoration: underline;" class="">ghc-steering-committee@haskell.org</a><br class=""><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-steering-committee&data=04%7C01%7Csimonpj%40microsoft.com%7C4209473397bb4a1e123d08d957dc5f41%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637637426303892149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UhgwhcfU2P5%2BBwQX0lokFK8wIlFnW5RC%2BdSCg24oSzE%3D&reserved=0" target="_blank" style="color: blue; text-decoration: underline;" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><o:p class=""></o:p></p></blockquote></div></div></div></div></blockquote></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">ghc-steering-committee mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="mailto:ghc-steering-committee@haskell.org" class="">ghc-steering-committee@haskell.org</a></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a></span></div></blockquote></div><br class=""></div></body></html>