[commit: ghc] wip/T12618: Get rid of unitDataConId (use ConApp instead) (3733c4d)

git at git.haskell.org git at git.haskell.org
Thu Oct 6 23:20:26 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T12618
Link       : http://ghc.haskell.org/trac/ghc/changeset/3733c4dfc50d578bef3e6a287f28841ce16f309a/ghc

>---------------------------------------------------------------

commit 3733c4dfc50d578bef3e6a287f28841ce16f309a
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Oct 4 14:49:40 2016 -0400

    Get rid of unitDataConId (use ConApp instead)


>---------------------------------------------------------------

3733c4dfc50d578bef3e6a287f28841ce16f309a
 compiler/coreSyn/MkCore.hs     | 2 +-
 compiler/deSugar/DsCCall.hs    | 2 +-
 compiler/prelude/TysWiredIn.hs | 5 +----
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/compiler/coreSyn/MkCore.hs b/compiler/coreSyn/MkCore.hs
index 759ba79..b90a17d 100644
--- a/compiler/coreSyn/MkCore.hs
+++ b/compiler/coreSyn/MkCore.hs
@@ -367,7 +367,7 @@ mkCoreVarTupTy ids = mkBoxedTupleTy (map idType ids)
 -- | Build a small tuple holding the specified expressions
 -- One-tuples are flattened; see Note [Flattening one-tuples]
 mkCoreTup :: [CoreExpr] -> CoreExpr
-mkCoreTup []  = Var unitDataConId
+mkCoreTup []  = ConApp unitDataCon []
 mkCoreTup [c] = c
 mkCoreTup cs  = mkCoreConApps (tupleDataCon Boxed (length cs))
                               (map (Type . exprType) cs ++ cs)
diff --git a/compiler/deSugar/DsCCall.hs b/compiler/deSugar/DsCCall.hs
index 0d9bbb4..8f614ba 100644
--- a/compiler/deSugar/DsCCall.hs
+++ b/compiler/deSugar/DsCCall.hs
@@ -322,7 +322,7 @@ resultWrapper result_ty
 
   -- Base case 2: the unit type ()
   | Just (tc,_) <- maybe_tc_app, tc `hasKey` unitTyConKey
-  = return (Nothing, \_ -> Var unitDataConId)
+  = return (Nothing, \_ -> ConApp unitDataCon [])
 
   -- Base case 3: the boolean type
   | Just (tc,_) <- maybe_tc_app, tc `hasKey` boolTyConKey
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index b334967..035ae75 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -70,7 +70,7 @@ module TysWiredIn (
         mkTupleTy, mkBoxedTupleTy,
         tupleTyCon, tupleDataCon, tupleTyConName,
         promotedTupleDataCon,
-        unitTyCon, unitDataCon, unitDataConId, unitTy, unitTyConKey,
+        unitTyCon, unitDataCon, unitTy, unitTyConKey,
         pairTyCon,
         unboxedUnitTyCon, unboxedUnitDataCon,
         cTupleTyConName, cTupleTyConNames, isCTupleTyConName,
@@ -824,9 +824,6 @@ unitTyConKey = getUnique unitTyCon
 unitDataCon :: DataCon
 unitDataCon   = head (tyConDataCons unitTyCon)
 
-unitDataConId :: Id
-unitDataConId = dataConWorkId unitDataCon
-
 pairTyCon :: TyCon
 pairTyCon = tupleTyCon Boxed 2
 



More information about the ghc-commits mailing list