Skip to content
  • Ryan Scott's avatar
    Make GHC generics capable of handling unboxed types · 6cde981a
    Ryan Scott authored
    This adds a data family (`URec`) and six data family instances (`UAddr`,
    `UChar`, `UDouble`, `UFloat`, `UInt`, and `UWord`) which a `deriving
    Generic(1)` clause will generate if it sees `Addr#`, `Char#`, `Double#`,
    `Float#`, `Int#`, or `Word#`, respectively. The programmer can then
    provide instances for these data family instances to provide custom
    implementations for unboxed types, similar to how derived `Eq`, `Ord`,
    and `Show` instances currently special-case unboxed types.
    
    Fixes #10868.
    
    Test Plan: ./validate
    
    Reviewers: goldfire, dreixel, bgamari, austin, hvr, kosmikus
    
    Reviewed By: dreixel, kosmikus
    
    Subscribers: simonpj, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1239
    
    GHC Trac Issues: #10868
    6cde981a