"deriving newtype instance" generates an infinite loop
I was trying to create a newtype instance for the SqlSelect
(https://hackage.haskell.org/package/esqueleto-2.5.3/docs/Database-Esqueleto-Internal-Sql.html#t:SqlSelect) class from the esqueleto
library. It has multiple type arguments so I was using StandaloneDeriving and DerivingStrategies:
newtype X a b = X { unX :: b }
deriving newtype instance SqlSelect b c => SqlSelect (X a b) (X a c)
Unfortunately, this generates code which must include an infinite loop, because the compiled code spins, but replacing it with the obvious handwritten instance seems to fix the problem.
Apologies if this has been reported or fixed elsewhere, I was unable to find any matching issues.