Skip to content

'Fun' pattern in COMPLETE set in Data.Typeable.Internal can be removed

Data.Typeable.Internal contains the following comment:

-- TODO: Remove Fun when #14253 is fixed
{-# COMPLETE Fun, App, Con  #-}
{-# COMPLETE Fun, App, Con' #-}

Now, #14253 (closed) has been fixed a while ago, by !963 (closed), so we can remove Fun.

Doing so causes redundant pattern warnings to be emitted in GHC.Utils.Binary.Typeable and Data.Binary.Class (from the binary library). To handle this in a backwards compatible way, I believe the following course of action needs to be taken:

  1. remove Fun from the above two COMPLETE sets in Data.Typeable.Internal,
  2. bump base to 4.17,
  3. add CPP instructions in GHC.Utils.Binary.Typeable and Data.Binary.Class which conditionally remove these extra cases when base >= 4.17.

I've made a PR to binary here which should address (3) above; an almost identical patch can be made to GHC.Utils.Binary.Typeable.

Edited by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information