[commit: ghc] master: Make GHC generics capable of handling unboxed types (6cde981)
git at git.haskell.org
git at git.haskell.org
Sat Oct 3 18:01:27 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6cde981a8788b225819be28659caddc35b77972d/ghc
>---------------------------------------------------------------
commit 6cde981a8788b225819be28659caddc35b77972d
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date: Sat Oct 3 19:21:37 2015 +0200
Make GHC generics capable of handling unboxed types
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
>---------------------------------------------------------------
6cde981a8788b225819be28659caddc35b77972d
compiler/prelude/PrelNames.hs | 65 ++++++++++---
compiler/typecheck/TcGenGenerics.hs | 132 ++++++++++++++++++++-------
docs/users_guide/7.12.1-notes.rst | 3 +
docs/users_guide/glasgow_exts.rst | 42 +++++++++
libraries/base/GHC/Generics.hs | 108 +++++++++++++++++++++-
libraries/base/changelog.md | 4 +
testsuite/tests/generics/GEq/GEq1.hs | 33 +++++--
testsuite/tests/generics/GEq/GEq1.stdout | 2 +
testsuite/tests/generics/GEq/GEq1A.hs | 18 +++-
testsuite/tests/generics/GShow/GShow.hs | 16 +++-
testsuite/tests/generics/GShow/GShow1.stdout | 1 +
testsuite/tests/generics/GShow/Main.hs | 10 +-
testsuite/tests/generics/T8468.stderr | 2 +-
13 files changed, 377 insertions(+), 59 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6cde981a8788b225819be28659caddc35b77972d
More information about the ghc-commits
mailing list