<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">I still don't get the "split in two" thing. The proposal is quite clear about the delta to ExplicitNameSpaces. The fact that the latter is not well specified isn't the current author's fault; and the delta makes sense as part of this proposal.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I think we should accept this one, and politely ask the author if they would consider (as a favour) writing a delta to the ExplicitNameSpaces proposal (I assume there is one?) to clarify it.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 12 Dec 2022 at 22:05, Chris Dornan <<a href="mailto:chris@chrisdornan.com">chris@chrisdornan.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In this case, for sure, responsibility for fixing up namespace documentation should not fall on the author of this proposal. I am thinking more that they should be strongly encouraged to submit the follow-up proposal and we provide or identify whatever assistance necessary to get the job done. It will definitely get us to a better place in my view.<br>
<br>
It sounds like we are in strong agreement.<br>
<br>
Chris<br>
<br>
<br>
<br>
> On 12 Dec 2022, at 20:11, Adam Gundry <<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a>> wrote:<br>
> <br>
> On 12/12/2022 16:50, Chris Dornan wrote:<br>
>> I really think we should split this proposal into two, one to deal with warnings and the other to deal with namespaces. The warnings look to me ready to go.<br>
>> I am further thinking that we should really welcome the followup namespace proposal as an opportunity to clarify and properly document namespaces.<br>
>> I am sorry, I was added to the proposal very late thinking it was technically sound but I am realising it is far from the case.<br>
>> Finally, I am quite surprised at how little documentation there seems to be on ExplicitNamespaces. Should we be asking that revised documentation be propared as part of the proposal process and that the documentation be up to scratch? It seems the least we should be asking and much more important than requiring an implementation plan. This process is increasingly the only game in town when it comes to driving forward and defining Haskell and we need to make sure stuff is being written down properly.<br>
> <br>
> This is a bit of a tricky issue, I think. I agree that we should strive for a proper specification of ExplicitNamespaces. The current state seems to be sadly lacking, especially if we want ExplicitNamespaces to be in GHC2023. That said, there's a risk that proposal authors will be discouraged if proposing changes entails writing specifications for existing under-specified features!<br>
> <br>
> I wonder if anyone has attempted to extend "A Formal Specification of the Haskell 98 Module System" to more recent GHC extensions?<br>
> <br>
> Adam<br>
> <br>
> <br>
>>> On 12 Dec 2022, at 12:21, Adam Gundry <<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a> <mailto:<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a>>> wrote:<br>
>>> <br>
>>> On 12/12/2022 11:39, Simon Peyton Jones wrote:<br>
>>>> {-# LANGUAGE ExplicitNamespaces #-}<br>
>>>> module N where<br>
>>>> import M (T(type MkT)) -- NB "type" import of a data constructor<br>
>>>> v = MkT -- usage at term level Crumbs. I had not realised the proposal is to allow *nested* uses of 'type' in import lists, as you show above.<br>
>>> <br>
>>> The nested use is already possible with ExplicitNamespaces. Currently it allows<br>
>>> <br>
>>> import M (T(type MkT))<br>
>>> import M (type MkT)<br>
>>> import M (pattern MkT)<br>
>>> <br>
>>> whereas the proposal extends it to add the possibility to write<br>
>>> <br>
>>> import M type (MkT)<br>
>>> import M data (MkT)<br>
>>> import M (data MkT)<br>
>>> <br>
>>> <br>
>>>> In general, I don't feel the extensions to ExplicitNamespaces included<br>
>>>> in the proposal are very clearly specified. Actually isn't the proposal pretty clear on this, namely the first bullet of proposed change spec <<a href="https://github.com/hithroc/ghc-proposals/blob/master/proposals/0000-support-pun-free-code.md#2-proposed-change-specification" rel="noreferrer" target="_blank">https://github.com/hithroc/ghc-proposals/blob/master/proposals/0000-support-pun-free-code.md#2-proposed-change-specification</a> <<a href="https://github.com/hithroc/ghc-proposals/blob/master/proposals/0000-support-pun-free-code.md#2-proposed-change-specification" rel="noreferrer" target="_blank">https://github.com/hithroc/ghc-proposals/blob/master/proposals/0000-support-pun-free-code.md#2-proposed-change-specification</a>>>. It only covers<br>
>>>> import M *type *<br>
>>>> import M *data *as MD<br>
>>>> where I have emboldened the new bits. Nothing about the contents of import lists. Why did you think your example is covered by the proposal?<br>
>>> <br>
>>> I'm trying to understand what<br>
>>> <br>
>>> import M type (MkT)<br>
>>> <br>
>>> means where MkT is a data constructor (or if it raises some kind of error). This was by analogy to the existing<br>
>>> <br>
>>> import M (T(type MkT))<br>
>>> <br>
>>> which means something today, albeit not necessarily a very sensible thing (per <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a> <<a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a>>).<br>
>>> <br>
>>> I don't see a clear specification of the proposed (extended) semantics of ExplicitNamespaces in the proposal, but perhaps I've missed something?<br>
>>> <br>
>>> Cheers,<br>
>>> <br>
>>> Adam<br>
>>> <br>
>>> <br>
>>>> On Mon, 12 Dec 2022 at 09:15, Adam Gundry <<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a> <mailto:<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a>> <mailto:<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a> <mailto:<a href="mailto:adam@well-typed.com" target="_blank">adam@well-typed.com</a>>>> wrote:<br>
>>>> Actually, reading <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a> <<a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a>><br>
>>>> <<a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a> <<a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a>>> I<br>
>>>> realised I'm unclear how the proposed extensions to ExplicitNamespaces<br>
>>>> are supposed to work. The existing situation is apparently that for a<br>
>>>> (non-punned) data constructor, it is possible to use either a<br>
>>>> pattern or<br>
>>>> type qualifier in an import list (presumably because DataKinds means<br>
>>>> the<br>
>>>> constructor is in scope at both the term and type levels), and the<br>
>>>> imported constructor is then usable in both contexts.<br>
>>>> For example, the following is accepted at present:<br>
>>>> module M where<br>
>>>> data T = MkT<br>
>>>> {-# LANGUAGE ExplicitNamespaces #-}<br>
>>>> module N where<br>
>>>> import M (T(type MkT)) -- NB "type" import of a data constructor<br>
>>>> v = MkT -- usage at term level<br>
>>>> The present proposal says "With type specified in the import, only<br>
>>>> identifiers belonging to the type namespace will be brought into the<br>
>>>> scope." I'm not exactly sure how to interpret this, does it mean the<br>
>>>> following alternative will be accepted or rejected?<br>
>>>> module N where<br>
>>>> import M type (MkT)<br>
>>>> v = MkT<br>
>>>> I'm worried we will end up with a situation where ExplicitNamespaces<br>
>>>> does subtly different things depending on the position of the keyword.<br>
>>>> In general, I don't feel the extensions to ExplicitNamespaces included<br>
>>>> in the proposal are very clearly specified. Given the discussion about<br>
>>>> exactly which parts belong to ExplicitNamespaces/PatternSynonyms versus<br>
>>>> separate extensions, perhaps we should accept the parts relating to<br>
>>>> -Wpuns/-Wpun-bindings, but ask for the ExplicitNamespaces changes to be<br>
>>>> proposed separately?<br>
>>>> Cheers,<br>
>>>> Adam<br>
>>>> On 09/12/2022 11:11, Adam Gundry wrote:<br>
>>>> > I'm broadly in favour of accepting the proposal. I realise the<br>
>>>> history<br>
>>>> > is complex here, so I don't think we should ask anyone to rewrite<br>
>>>> things<br>
>>>> > further, though in general it would be nicer to have separate<br>
>>>> proposals<br>
>>>> > for -Wpuns/-Wpun-bindings (which is unambiguously fine) and for the<br>
>>>> > changes to imports (which as Joachim points out raise issues).<br>
>>>> ><br>
>>>> > I'm a bit concerned that the proposal does not motivate or specify<br>
>>>> > -Wpattern-namespace-qualified very well.<br>
>>>> ><br>
>>>> ><br>
>>>> > On 08/12/2022 08:33, Joachim Breitner wrote:<br>
>>>> >> ...<br>
>>>> >><br>
>>>> >> This gives us (at least) these options:<br>
>>>> >><br>
>>>> >> 1. Leave ExplicitNamespaces alone, add ExplicitNamespaces to<br>
>>>> GHC2023,<br>
>>>> >> introduce one or two new extensions for the newer changes.<br>
>>>> >> 2. Extend ExplicitNamespaces, and don’t add it already to GHC2023,<br>
>>>> >> disregarding issue #551.<br>
>>>> >> 3. Add ExplicitNamespaces to GHC2023, and still add it to GHC2023,<br>
>>>> >> arguing that GHC20xx allows more liberal (backward-compatibile)<br>
>>>> >> changes than, say, Haskell2010 would allow.<br>
>>>> >><br>
>>>> >> Certainly 1 is the least bold move. I am not sure what the best way<br>
>>>> >> forwards is, and welcome other opinions.<br>
>>>> ><br>
>>>> > I would prefer a variant of 1: allow "data" as a keyword in<br>
>>>> import lists<br>
>>>> > under ExplicitNamespaces, but make the other changes under other<br>
>>>> > extensions.<br>
>>>> ><br>
>>>> > As I've said previously, I have a general preference for multiple<br>
>>>> small,<br>
>>>> > orthogonal extensions rather than changing existing extensions to<br>
>>>> add<br>
>>>> > unrelated features that happen to be in similar territory. I realise<br>
>>>> > this is controversial, of course.<br>
>>>> ><br>
>>>> > Cheers,<br>
>>>> ><br>
>>>> > Adam<br>
> <br>
> <br>
> -- <br>
> Adam Gundry, Haskell Consultant<br>
> Well-Typed LLP, <a href="https://www.well-typed.com/" rel="noreferrer" target="_blank">https://www.well-typed.com/</a><br>
> <br>
> Registered in England & Wales, OC335890<br>
> 27 Old Gloucester Street, London WC1N 3AX, England<br>
> <br>
> _______________________________________________<br>
> ghc-steering-committee mailing list<br>
> <a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
> <a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
<br>
_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>