summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-12-14 17:37:25 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2012-12-14 17:37:39 +0000
commitfaa8ff40162da23a57b58fc128b0d672a8107a46 (patch)
tree7561f71178e8b7c6bca8313434943951d97d5983 /compiler/parser
parent566920c77bce252d807e9a7cc3da862e5817d340 (diff)
downloadhaskell-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/parser')
-rw-r--r--compiler/parser/Parser.y.pp2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 9db8f41452..4833a1805a 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -1007,7 +1007,7 @@ infixtype :: { LHsType RdrName }
strict_mark :: { Located HsBang }
: '!' { L1 HsStrict }
| '{-# UNPACK' '#-}' '!' { LL HsUnpack }
- | '{-# NOUNPACK' '#-}' '!' { LL HsNoUnpack }
+ | '{-# NOUNPACK' '#-}' '!' { LL HsStrict }
-- A ctype is a for-all type
ctype :: { LHsType RdrName }