[GHC] #16382: Lifting a function from where clause to top level causes compilation time to triple