[ghc-steering-committee] #409: Exportable named defaults, Recommendation: Partial Accept

Eric Seidel eric at seidel.io
Mon Jun 21 02:24:24 UTC 2021


On Thu, Jun 17, 2021, at 10:08, Spiwack, Arnaud wrote:
> > Since the Prelude is implicitly imported without an import list, both A and C would let you avoid an extra import. Same goes for Prelude replacements.
> 
> I fully agree with this statement. (I don't think that I have a 
> preference between A and C)

Great, then I think we have broad support among the committee members who've participated in this discussion for some form of implicit import of defaulting rules. I recommend we treat defaulting rules like any other importable entity to match how the proposal treats them in export lists, ie given

```
module Defaults where
default IsString (Text)
```

we have the following import behavior

```
import Defaults  -- imports `default IsString (Text)`
import Defaults ()  -- does not import `default IsString (Text)`
import Defaults (default IsString) -- imports `default IsString (Text)`
import Defaults hiding (default IsString) -- does not import `default IsString (Text)`
import Defaults qualified -- imports `default IsString (Text)`
```

By my reading, Simon PJ, Joachim, Alejandro, Arnaud, and Richard (provided we have a warning) should all be happy with this path. I believe we also have broad agreement that imports need not be guarded by any extension. If you disagree please speak up!

I have not heard anything from Vitaly, Cale, Tom, Simon M, or Vlad. If you have any thoughts on this proposal, please speak up now.

I'll discuss the proposed changes (treating imported defaults like other importable entities, and the warning) with the author. As usual, I'll treat silence from the committee as assent, and will declare the proposal accepted next Sunday 6/27 if there are no objections.

Thanks!
Eric


More information about the ghc-steering-committee mailing list