diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-12-14 17:37:25 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-12-14 17:37:39 +0000 |
commit | faa8ff40162da23a57b58fc128b0d672a8107a46 (patch) | |
tree | 7561f71178e8b7c6bca8313434943951d97d5983 /compiler/deSugar/DsMeta.hs | |
parent | 566920c77bce252d807e9a7cc3da862e5817d340 (diff) | |
download | haskell-faa8ff40162da23a57b58fc128b0d672a8107a46.tar.gz |
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.
Diffstat (limited to 'compiler/deSugar/DsMeta.hs')
-rw-r--r-- | compiler/deSugar/DsMeta.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index 405b7687a5..f25039c8a9 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -519,9 +519,9 @@ repBangTy ty= do rep2 strictTypeName [s, t] where (str, ty') = case ty of - L _ (HsBangTy HsUnpack ty) -> (unpackedName, ty) - L _ (HsBangTy _ ty) -> (isStrictName, ty) - _ -> (notStrictName, ty) + L _ (HsBangTy (HsBang True) ty) -> (unpackedName, ty) + L _ (HsBangTy _ ty) -> (isStrictName, ty) + _ -> (notStrictName, ty) ------------------------------------------------------- -- Deriving clause |