[GHC] #9974: Allow more general structural recursion without UndecidableInstances