[commit: ghc] master: Refactor and improve the promotion inference (09ff0e0)
Simon Peyton Jones
simonpj at microsoft.com
Fri Jan 25 13:50:29 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/09ff0e0da88272fa4a8f117bbc90cea9e444ab5d
>---------------------------------------------------------------
commit 09ff0e0da88272fa4a8f117bbc90cea9e444ab5d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Jan 25 12:48:06 2013 +0000
Refactor and improve the promotion inference
It should be the case that either an entire mutually recursive
group of data type declarations can be promoted, or none of them.
It's really odd to promote some data constructors of a type but
not others. Eg
data T a = T1 a | T2 Int
Here T1 is sort-of-promotable but T2 isn't (becuase Int isn't
promotable).
This patch makes it all-or-nothing. At the same time I've made
the TyCon point to its promoted cousin (via the tcPromoted field
of an AlgTyCon), as well as vice versa (via the ty_con field of
PromotedTyCon).
The inference for the group is done in TcTyDecls, the same place
that infers which data types are recursive, another global question.
compiler/basicTypes/DataCon.lhs | 76 +++++++++-------
compiler/iface/BinIface.hs | 6 +-
compiler/iface/BuildTyCl.lhs | 16 ----
compiler/iface/IfaceSyn.lhs | 12 ++-
compiler/iface/MkIface.lhs | 1 +
compiler/iface/TcIface.lhs | 10 ++-
compiler/prelude/TysWiredIn.lhs | 30 ++++---
compiler/typecheck/TcGenGenerics.lhs | 5 +-
compiler/typecheck/TcHsType.lhs | 11 ++-
compiler/typecheck/TcInstDcls.lhs | 4 +-
compiler/typecheck/TcTyClsDecls.lhs | 36 ++++----
compiler/typecheck/TcTyDecls.lhs | 111 +++++++++++++++++++++---
compiler/types/TyCon.lhs | 38 ++++++--
compiler/vectorise/Vectorise/Generic/PData.hs | 1 +
compiler/vectorise/Vectorise/Type/TyConDecl.hs | 1 +
15 files changed, 245 insertions(+), 113 deletions(-)
Diff suppressed because of size. To see it, use:
git show 09ff0e0da88272fa4a8f117bbc90cea9e444ab5d
More information about the ghc-commits
mailing list