Eliminate some unsafeCoerce#s with deriving strategies
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 1 Oct 2016 21:58:27 +0000 (17:58 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 2 Oct 2016 00:01:29 +0000 (20:01 -0400)
commitf547b444fdaf1c86abede42bf4c4b1037f50f588
tree639e077bb18d8d7072bd5f146732384fac1b427d
parentb0d53a839da0149e0142da036b6ebf5a01b3216f
Eliminate some unsafeCoerce#s with deriving strategies

Currently, `Foreign.C.Types`, `Foreign.Ptr`, and `System.Posix.Types`
define `Read` and `Show` instances for the newtypes in those modules by
using `unsafeCoerce#`. We can clean up this hack by using the `newtype`
deriving strategy.

Reviewers: hvr, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2556
libraries/base/Foreign/C/Types.hs
libraries/base/Foreign/Ptr.hs
libraries/base/System/Posix/Types.hs
libraries/base/include/CTypes.h