• Ömer Sinan Ağacan's avatar
    Fix DeriveGeneric for types with same OccName (#10487) · b08a533d
    Ömer Sinan Ağacan authored
    Summary:
    DeriveGeneric generates some data types (for data type constructors and for
    selectors of those constructors) and instances for those types. This patch
    changes name generation for these new types to make it working with data types
    with same names imported from different modules and with data types with same
    names imported from same modules(using module imports).
    
    Bonus content:
    
    - Some refactoring in `TcGenGenerics.metaTyConsToDerivStuff` to remove some
      redundant partial function applications and to remove a duplicated function.
    - Remove some unused names from `OccName`. (those were used for an old
      implementation of `DeriveGeneric`)
    
    Reviewers: kosmikus, simonpj, dreixel, ezyang, bgamari, austin
    
    Reviewed By: bgamari, austin
    
    Subscribers: ezyang, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1081
    
    GHC Trac Issues: #10487
    b08a533d
TcDeriv.hs 89.5 KB