• Ryan Scott's avatar
    Fix #12998 by removing CTimer · 513eb6a0
    Ryan Scott authored
    Summary:
    CTimer is a wrapper around `timer_t`, which is a typedef for `void*`
    on most platforms. The issue is that GHC's `FPTOOLS_CHECK_HTYPE` is not robust
    enough to discern pointer types from non-pointer types, so it mistakenly labels
    `timer_t` as a `Double` or `Int32` (depending on how many bits a pointer takes
    up on your platform). This wreaks havoc when trying to give it certain type
    class instances, as noted in
    https://phabricator.haskell.org/rGHCffc2327070dbb664bdb407a804121eacb2a7c734.
    
    For now, the simplest thing to do would be removing `CTimer`, since:
    
    1. The original author (@DanielG) didn't have a particular use in mind for
       `timer_t` when he fixed #12795.
    2. `CTimer` hasn't appeared in a release of `base` yet.
    
    Fixes #12998.
    
    Reviewers: austin, hvr, bgamari, DanielG, trofi
    
    Reviewed By: bgamari, trofi
    
    Subscribers: thomie, DanielG, erikd
    
    Differential Revision: https://phabricator.haskell.org/D2876
    
    GHC Trac Issues: #12795, #12998
    513eb6a0
Types.hs 5.14 KB