I just found out about a new Haskell extension called
DerivingVia. It looks incredibly powerful, especially when paired with
GeneralizedNewtypeDeriving. It would save me from writing a lot of boilerplate in the past! For details see this great YouTube video by Tweag.
Edit (on 29 July): Matt Parsons has written a blog post on how this might become a bit overwhelming in more complicated examples and how he proposes to fix that (also related proposal). An interesting read.
Edit (on 4 April 2023): Gabriella Gonzalez wrote a nice blog post explaining how
GeneralizedNewtypeDeriving can be used to tame
Edit (on 02 Sep 2023): There's another nice example of the usage of this on Sam Tay's blog.