Shorter derive syntax

I really like PureScript. One thing I really dislike however is how verbose instance derivation is. It’s gotten better since it’s been possible to leave out instance names but Haskell shows that it can be done way more concisely. Obviously I’m not the only one as this has been requested for a while (#3426, #1891).

data Color = Red | Green | Blue
  derive (Eq, Ord, Generic)

newtype Score = Score Int
  derive newtype (Eq, Ord, Show)
  derive (Semigroup, Monoid) via (Additive Int)

I (and Claude Code) have been working to add support for this.

It also adds standalone derive via, based on @kl0tl’s work in #3824.

The above is what you can write with this version. @afc has tested it too and it worked for him :smiley:
Draft PR here: Add derive clauses to data and newtype declarations by i-am-the-slime · Pull Request #4592 · purescript/purescript · GitHub

Now I’m mostly worried that there’s a general anti-AI stance that precludes this from getting in (I know from personal experience it can be very tedious to review AI generated slop, but I did vet this to the best of my knowledge [which might not be enough]).

If that’s not an obstacle it’d be great to get feedback on this.