[GHC] #8041: Extraction of Uniques is in some places done inefficiently