Request for feedback: deriving strategies syntax

Richard Eisenberg rae at cs.brynmawr.edu
Mon Jul 18 14:28:24 UTC 2016


> On Jul 18, 2016, at 9:59 AM, Ryan Scott <ryan.gl.scott at gmail.com> wrote:
> 
>> The one idea I can suggest in this space (somewhat tongue-in-cheek, but feel free to take it seriously) is `bespoke`
> 
> It might be a tongue-in-cheek suggestion, but I _really_ like it. It
> captures the intended semantics better than any other previous
> suggestion, I think. And we're already going to be appropriating a new
> keyword with "anyclass", so why not take "bespoke" as well? :)
> 
> Please stop me if I've slipped into madness here.

We don't actually have to worry about keyword snatching, as there is no other lowercase word that can appear directly after `deriving`. We're happily in a new part of the grammar.

On "bespoke":
Pros:
 * It has precisely the right meaning
 * It's a fun word. (Fellow Americans, please update if this disagrees with your experience:) At least for Americans, for whom the word is instantly associated with spiffy haberdashery sold on Savile Row, London. It was actually quite a surprise to me when living in the UK that bespoke is used for other things as well. Example from my time there: I once went on a bespoke snowshoeing trip to France.

Cons:
 * It's a fun word. People from those other languages with their boring OOP terms already think we're strange for having monoids and monads. Not to mention profunctors. What will they think of a bespoke Functor?

I'm clearly enjoying this way too much.

> 
> Plus, on a superficial level, I like keeping the deriving strategy
> name outside of the parentheses. I think it makes clear that these
> keywords aren't modifying the type we're deriving, only the means by
> which we're deriving it. Of course, you may feel differently than I
> do, so please speak up if you disagree!
 
I actually agree here. This keeps all the keywords clustered together instead of interspersed with the more interesting bits.

Richard


More information about the ghc-devs mailing list