<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 really think we should split this pr<span style="font-size: 13px;" class="">oposal into two, one to deal with warnings and the other to deal with namespaces. The warnings look to me ready to go.</span><div class=""><font size="2" class=""><br class=""></font></div><div class=""><font size="2" class="">I am further thinking that we should really welcome the followup namespace proposal as an opportunity to clarify and properly document namespaces.</font></div><div class=""><font size="2" class=""><br class=""></font></div><div class=""><font size="2" class="">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.</font></div><div class=""><font size="2" class=""><br class=""></font></div><div class=""><font size="2" class="">Finally, I am quite surprised at how little documentation there seems to be on </font><span style="color: rgb(0, 0, 0); font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; font-size: 14.4px; font-variant-ligatures: normal; font-weight: 700; orphans: 2; widows: 2; background-color: rgb(252, 252, 252); text-decoration-thickness: initial;" class="">ExplicitNamespaces.</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: small;" class=""> Should we be asking that revised documentation be propared as part of </span><font size="2" class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">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.</span></font></font></div><div class=""><font size="2" class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></font></div><div class=""><font size="2" class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Chris<br class=""></span></font></font><div class=""><font size="2" class=""><br class=""></font></div><div class=""><font size="2" class=""><br class=""></font></div><div class=""><font size="2" class=""><br class=""></font><div><br class=""><blockquote type="cite" class=""><div class="">On 12 Dec 2022, at 12:21, Adam Gundry <<a href="mailto:adam@well-typed.com" class="">adam@well-typed.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 12/12/2022 11:39, Simon Peyton Jones wrote:<br class=""><blockquote type="cite" class=""> {-# LANGUAGE ExplicitNamespaces #-}<br class=""> module N where<br class=""> import M (T(type MkT)) -- NB "type" import of a data constructor<br class=""> 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 class=""></blockquote><br class="">The nested use is already possible with ExplicitNamespaces. Currently it allows<br class=""><br class=""> import M (T(type MkT))<br class=""> import M (type MkT)<br class=""> import M (pattern MkT)<br class=""><br class="">whereas the proposal extends it to add the possibility to write<br class=""><br class=""> import M type (MkT)<br class=""> import M data (MkT)<br class=""> import M (data MkT)<br class=""><br class=""><br class=""><blockquote type="cite" class=""> In general, I don't feel the extensions to ExplicitNamespaces included<br class=""> 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" class="">https://github.com/hithroc/ghc-proposals/blob/master/proposals/0000-support-pun-free-code.md#2-proposed-change-specification</a>>. It only covers<br class="">import M *type *<br class="">import M *data *as MD<br class="">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 class=""></blockquote><br class="">I'm trying to understand what<br class=""><br class=""> import M type (MkT)<br class=""><br class="">means where MkT is a data constructor (or if it raises some kind of error). This was by analogy to the existing<br class=""><br class=""> import M (T(type MkT))<br class=""><br class="">which means something today, albeit not necessarily a very sensible thing (per <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" class="">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a>).<br class=""><br class="">I don't see a clear specification of the proposed (extended) semantics of ExplicitNamespaces in the proposal, but perhaps I've missed something?<br class=""><br class="">Cheers,<br class=""><br class="">Adam<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Mon, 12 Dec 2022 at 09:15, Adam Gundry <<a href="mailto:adam@well-typed.com" class="">adam@well-typed.com</a> <<a href="mailto:adam@well-typed.com" class="">mailto:adam@well-typed.com</a>>> wrote:<br class=""> Actually, reading <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" class="">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a><br class=""> <<a href="https://gitlab.haskell.org/ghc/ghc/-/issues/22581" class="">https://gitlab.haskell.org/ghc/ghc/-/issues/22581</a>> I<br class=""> realised I'm unclear how the proposed extensions to ExplicitNamespaces<br class=""> are supposed to work. The existing situation is apparently that for a<br class=""> (non-punned) data constructor, it is possible to use either a<br class=""> pattern or<br class=""> type qualifier in an import list (presumably because DataKinds means<br class=""> the<br class=""> constructor is in scope at both the term and type levels), and the<br class=""> imported constructor is then usable in both contexts.<br class=""> For example, the following is accepted at present:<br class=""> module M where<br class=""> data T = MkT<br class=""> {-# LANGUAGE ExplicitNamespaces #-}<br class=""> module N where<br class=""> import M (T(type MkT)) -- NB "type" import of a data constructor<br class=""> v = MkT -- usage at term level<br class=""> The present proposal says "With type specified in the import, only<br class=""> identifiers belonging to the type namespace will be brought into the<br class=""> scope." I'm not exactly sure how to interpret this, does it mean the<br class=""> following alternative will be accepted or rejected?<br class=""> module N where<br class=""> import M type (MkT)<br class=""> v = MkT<br class=""> I'm worried we will end up with a situation where ExplicitNamespaces<br class=""> does subtly different things depending on the position of the keyword.<br class=""> In general, I don't feel the extensions to ExplicitNamespaces included<br class=""> in the proposal are very clearly specified. Given the discussion about<br class=""> exactly which parts belong to ExplicitNamespaces/PatternSynonyms versus<br class=""> separate extensions, perhaps we should accept the parts relating to<br class=""> -Wpuns/-Wpun-bindings, but ask for the ExplicitNamespaces changes to be<br class=""> proposed separately?<br class=""> Cheers,<br class=""> Adam<br class=""> On 09/12/2022 11:11, Adam Gundry wrote:<br class=""> > I'm broadly in favour of accepting the proposal. I realise the<br class=""> history<br class=""> > is complex here, so I don't think we should ask anyone to rewrite<br class=""> things<br class=""> > further, though in general it would be nicer to have separate<br class=""> proposals<br class=""> > for -Wpuns/-Wpun-bindings (which is unambiguously fine) and for the<br class=""> > changes to imports (which as Joachim points out raise issues).<br class=""> ><br class=""> > I'm a bit concerned that the proposal does not motivate or specify<br class=""> > -Wpattern-namespace-qualified very well.<br class=""> ><br class=""> ><br class=""> > On 08/12/2022 08:33, Joachim Breitner wrote:<br class=""> >> ...<br class=""> >><br class=""> >> This gives us (at least) these options:<br class=""> >><br class=""> >> 1. Leave ExplicitNamespaces alone, add ExplicitNamespaces to<br class=""> GHC2023,<br class=""> >> introduce one or two new extensions for the newer changes.<br class=""> >> 2. Extend ExplicitNamespaces, and don’t add it already to GHC2023,<br class=""> >> disregarding issue #551.<br class=""> >> 3. Add ExplicitNamespaces to GHC2023, and still add it to GHC2023,<br class=""> >> arguing that GHC20xx allows more liberal (backward-compatibile)<br class=""> >> changes than, say, Haskell2010 would allow.<br class=""> >><br class=""> >> Certainly 1 is the least bold move. I am not sure what the best way<br class=""> >> forwards is, and welcome other opinions.<br class=""> ><br class=""> > I would prefer a variant of 1: allow "data" as a keyword in<br class=""> import lists<br class=""> > under ExplicitNamespaces, but make the other changes under other<br class=""> > extensions.<br class=""> ><br class=""> > As I've said previously, I have a general preference for multiple<br class=""> small,<br class=""> > orthogonal extensions rather than changing existing extensions to<br class=""> add<br class=""> > unrelated features that happen to be in similar territory. I realise<br class=""> > this is controversial, of course.<br class=""> ><br class=""> > Cheers,<br class=""> ><br class=""> > Adam<br class=""></blockquote><br class="">-- <br class="">Adam Gundry, Haskell Consultant<br class="">Well-Typed LLP, <a href="https://www.well-typed.com/" class="">https://www.well-typed.com/</a><br class=""><br class="">Registered in England & Wales, OC335890<br class="">27 Old Gloucester Street, London WC1N 3AX, England<br class=""><br class="">_______________________________________________<br class="">ghc-steering-committee mailing list<br class=""><a href="mailto:ghc-steering-committee@haskell.org" class="">ghc-steering-committee@haskell.org</a><br class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>