GeneralizedNewtypeDeriving lets a newtype derive additional type-class instances from its underlying type. Without it, the newtype strategy only covers Eq, Ord, Enum, and Bounded; enabling it also supports classes such as Semigroup and Monoid. section 15.1.2
Deriving instances for a log
A log can wrap a list of entries while reusing the list's Semigroup and Monoid behavior: newtype Log = Log [LogEntry] deriving stock (Show, Eq) deriving newtype (Semigroup, Monoid). The resulting Log can serve as accumulated output for WriterT. section 15.1.2
