[GHC] #12643: class declaration works in ghci, but not in a file