Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/faa8ff40162da23a57b58fc128b0d672a8107a46 >--------------------------------------------------------------- commit faa8ff40162da23a57b58fc128b0d672a8107a46 Author: Simon Peyton Jones <simo...@microsoft.com> Date: Fri Dec 14 17:37:25 2012 +0000 Major refactoring of the way that UNPACK pragmas are handled The situation was pretty dire. The way in which data constructors were handled, notably the mapping between their *source* argument types and their *representation* argument types (after seq'ing and unpacking) was scattered in three different places, and hard to keep in sync. Now it is all in one place: * The dcRep field of a DataCon gives its representation, specified by a DataConRep * As well as having the wrapper, the DataConRep has a "boxer" of type DataConBoxer (defined in MkId for loopy reasons). The boxer used at a pattern match to reconstruct the source-level arguments from the rep-level bindings in the pattern match. * The unboxing in the wrapper and the boxing in the boxer are dual, and are now constructed together, by MkId.mkDataConRep. This is the key function of this change. * All the computeBoxingStrategy code in TcTyClsDcls disappears. Much nicer. There is a little bit of refactoring left to do; the strange deepSplitProductType functions are now called only in WwLib, so I moved them there, and I think they could be tidied up further. compiler/basicTypes/BasicTypes.lhs | 27 +- compiler/basicTypes/DataCon.lhs | 250 ++++++------- compiler/basicTypes/DataCon.lhs-boot | 3 +- compiler/basicTypes/MkId.lhs | 652 +++++++++++++++++++--------------- compiler/basicTypes/MkId.lhs-boot | 10 +- compiler/deSugar/DsMeta.hs | 6 +- compiler/deSugar/DsUtils.lhs | 12 +- compiler/hsSyn/Convert.lhs | 4 +- compiler/iface/BinIface.hs | 19 +- compiler/iface/BuildTyCl.lhs | 8 +- compiler/iface/MkIface.lhs | 2 +- compiler/main/DynFlags.hs | 2 +- compiler/parser/Parser.y.pp | 2 +- compiler/prelude/TysWiredIn.lhs | 8 +- compiler/stranal/WwLib.lhs | 65 ++++- compiler/typecheck/TcInstDcls.lhs | 11 +- compiler/typecheck/TcTyClsDecls.lhs | 220 ++---------- compiler/types/TyCon.lhs | 37 +-- 18 files changed, 634 insertions(+), 704 deletions(-) Diff suppressed because of size. To see it, use: git show faa8ff40162da23a57b58fc128b0d672a8107a46 _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc