[ghc-steering-committee] A few more pleas

Iavor Diatchki iavor.diatchki at gmail.com
Tue Dec 8 16:59:39 UTC 2020


Hello,

On Mon, Dec 7, 2020 at 7:47 PM Richard Eisenberg <rae at richarde.dev> wrote:

> A plea for DerivingStrategies: GHC currently chooses which strategy to use
> rather arbitrarily. (For example, did you know that Eq and Ord are derived
> by GeneralizedNewtypeDeriving whenever possible, even when that extension
> isn't enabled?) And Show is always derived by the `stock` strategy, even
> when GND is enabled (and otherwise possible). Instead, DerivingStrategies
> allows users to be explicit, and (in my opinion) should be a matter of good
> style, just like top-level type signatures. Having to enable the extension
> to use good style is an annoying hurdle. While the set of strategies may
> evolve, the idea of writing out strategies (and their syntax) feels stable
> to me.
>

I agree that this is a problem, but instead of turning on more extensions
by default, I think we should simply not turn on the GND by default.   I
really think that design for `deriving` is not quite at the state where it
should be on by default.

A plea for NamedWildCards: This feature allows type variables beginning
> with an underscore to be treated as a component in a partial type
> signature. Critically (for this plea), a type signature with a named wild
> card will not be accepted without -XPartialTypeSignatures. I do *not*
> advocate for -XPartialTypeSignatures! So, having -XNamedWildCards on simply
> means that we get an informative error message when the user writes a type
> variable beginning with an underscore. The only downside is that programs
> such as id :: _a -> _a are no longer accepted. But does anyone write type
> variables with leading underscores? If we think this is at all common, then
> I would change my mind here. Why have it on by default? Because it's not
> easily discoverable, and the error messages really are quite nice.
>

It seems odd to turn on an extension that doesn't do anything, and it is
entirely there to make *another* extension work better?   Wouldn't it be
better to make `PartialTypeSignatures` imply `NamedWildCards`?

A plea against MonoLocalBinds (and, hence, TypeFamilies): MonoLocalBinds is
> fork-like: it will mean that some Haskell98 programs will not be accepted.
> And to get those programs accepted, a user might need ScopedTypeVariables
> -- in specific, the aspect of ScopedTypeVariables that seems likeliest to
> change in the future. So I don't think we should have MonoLocalBinds on by
> default.
>

I think you are right on this, so I'll update my vote (I also don't think
that `TypeFamilies` should be on by default, as I mentioned in my other
e-mail)

-Iavor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20201208/4f44caf0/attachment-0001.html>


More information about the ghc-steering-committee mailing list