summaryrefslogtreecommitdiff
path: root/compiler/prelude/PrelNames.lhs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2013-11-22 15:23:22 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2013-11-22 18:59:28 +0000
commitf438464754ad9abd885acf3529606ca57945edc2 (patch)
treee2edaf1078865f544a55153c02bb1906099586c0 /compiler/prelude/PrelNames.lhs
parentb83666d4813b62b0b2da9b8238af6909c9f1dae0 (diff)
downloadhaskell-f438464754ad9abd885acf3529606ca57945edc2.tar.gz
Replace (State# RealWorld) with Void# where we just want a 0-bit value
We were re-using the super-magical "state token" type (which has VoidRep and is zero bits wide) for situations in which we simply want to lambda-abstract over a zero-bit argument. For example, join points: case (case x of { True -> e1; False -> e2 }) of Red -> f1 Blue -> True ==> let $j1 = \voidArg::Void# -> f1 in case x of True -> case e1 of Red -> $j1 void Blue -> True False -> case e2 of Red -> $j1 void Blue -> True This patch introduces * The new primitive type GHC.Prim.Void#, with PrimRep = VoidRep * A new global Id GHC.Prim.voidPrimId :: Void#. This has no binding because the code generator drops it, but is used as an argument (eg in the call of $j1) * A new local Id, MkId.voidArgId, which can be lambda-bound when you need to lambda-abstract over it. and uses them throughout. Now the State# thing is used only when we need state!
Diffstat (limited to 'compiler/prelude/PrelNames.lhs')
-rw-r--r--compiler/prelude/PrelNames.lhs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/prelude/PrelNames.lhs b/compiler/prelude/PrelNames.lhs
index 6223567451..85da3accb6 100644
--- a/compiler/prelude/PrelNames.lhs
+++ b/compiler/prelude/PrelNames.lhs
@@ -1357,7 +1357,7 @@ statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey,
typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey,
funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey,
- eqReprPrimTyConKey :: Unique
+ eqReprPrimTyConKey, voidPrimTyConKey :: Unique
statePrimTyConKey = mkPreludeTyConUnique 50
stableNamePrimTyConKey = mkPreludeTyConUnique 51
stableNameTyConKey = mkPreludeTyConUnique 52
@@ -1365,6 +1365,7 @@ eqPrimTyConKey = mkPreludeTyConUnique 53
eqReprPrimTyConKey = mkPreludeTyConUnique 54
mutVarPrimTyConKey = mkPreludeTyConUnique 55
ioTyConKey = mkPreludeTyConUnique 56
+voidPrimTyConKey = mkPreludeTyConUnique 57
wordPrimTyConKey = mkPreludeTyConUnique 58
wordTyConKey = mkPreludeTyConUnique 59
word8TyConKey = mkPreludeTyConUnique 60
@@ -1576,7 +1577,7 @@ wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey,
buildIdKey, errorIdKey, foldrIdKey, recSelErrorIdKey,
seqIdKey, irrefutPatErrorIdKey, eqStringIdKey,
noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey,
- runtimeErrorIdKey, patErrorIdKey,
+ runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey,
realWorldPrimIdKey, recConErrorIdKey,
unpackCStringUtf8IdKey, unpackCStringAppendIdKey,
unpackCStringFoldrIdKey, unpackCStringIdKey :: Unique
@@ -1601,6 +1602,7 @@ unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17
unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 19
unpackCStringIdKey = mkPreludeMiscIdUnique 20
+voidPrimIdKey = mkPreludeMiscIdUnique 21
unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey,
returnIOIdKey, newStablePtrIdKey,