Request for feedback: deriving strategies syntax

Ryan Scott ryan.gl.scott at gmail.com
Thu Aug 25 19:49:16 UTC 2016


Hello, everyone! Sorry for not being able to respond to some of the
recent feedback.

Well, it seems I'm at a bit of an impasse again. I originally changed
"builtin" to "bespoke" because enough GHC devs voiced their
displeasure (ranging from moderate to severe) with "builtin". I hoped
that choosing "bespoke" would strike a happy medium where we could
have a term that (1) reasonably describes its intended purpose, (2)
wouldn't be highly misleading upon an initial glance, and (3) wouldn't
be too off-putting to use as a reserved keyword.

Unfortunately, I over-estimated how well "bespoke" meets criterion 3,
since several people have _also_ voiced their displeasure with it!
(Again, ranging from moderate to severe.) So we're back to square one,
it seems. I don't want to push this patch without a general feeling of
community consensus, but the patch is complete after all, with the
exception of bikeshedding, so I'd like to try and come up with a
colo(u)r that folks will be happy with so we can proceed and I can
work on other things that need this feature.

So, instead of "builtin" and "bespoke", I propose reconsidering an
earlier suggestion of Elliot Cameron's: "standard". I had previously
expressed reservations about "standard" before, since I felt it might
be miscontrued as meaning "a Haskell standard" (e.g., the Haskell
Report). But upon further thought, I have actually come to like the
word "standard". Here's why:

1. It's simple. "Standard" is recognizable whether you speak American
English, British English, or pretty much any other variant that I'm
aware of.
2. It has precedent. A GHC error message already uses the phrase
"standard derivable classes" to refer to Eq, Ord, Functor, etc. If we
adopt "standard" as our keyword, then we could endow this phrase with
a more precise meaning.
3. It reflects history. This deriving strategy (that I'm proposing to
name "standard") was the very first deriving strategy that GHC
supported (to my knowledge), so it makes sense to refer to this
strategy as the "standard" one, since all other strategies were added
later.
4. It's not too ambiguous. As opposed to say, "default" (which could
be confused with -XDefaultSignatures, i.e., the anyclass strategy), I
think that "standard" has a pretty obvious connotation in the context
of deriving. There is the possibility of misinterpreting "standard" to
refer to the Haskell Report, but that wouldn't be the worst
misconception in the world to make, since several "standard derivable
classes" are actually in the Haskell Report (whereas neither
GeneralizedNewtypeDeriving nor DeriveAnyClass are).

What does everyone think?

Ryan S.


More information about the ghc-devs mailing list