[commit: template-haskell] master: The unit tuple is defined in a different module to other tuples (oddly) (0923cdc)
Simon Peyton Jones
simonpj at microsoft.com
Wed Aug 17 08:59:15 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/template-haskell
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/0923cdc6ba600e67987f88c67ca80bf2d7a05400
>---------------------------------------------------------------
commit 0923cdc6ba600e67987f88c67ca80bf2d7a05400
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Aug 17 07:58:36 2011 +0100
The unit tuple is defined in a different module to other tuples (oddly)
Fixes Trac #5409
>---------------------------------------------------------------
Language/Haskell/TH/Syntax.hs | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Language/Haskell/TH/Syntax.hs b/Language/Haskell/TH/Syntax.hs
index 18f6029..31e1300 100644
--- a/Language/Haskell/TH/Syntax.hs
+++ b/Language/Haskell/TH/Syntax.hs
@@ -582,8 +582,9 @@ mk_tup_name n_commas space
= Name occ (NameG space (mkPkgName "ghc-prim") tup_mod)
where
occ = mkOccName ('(' : replicate n_commas ',' ++ ")")
- -- XXX Should it be GHC.Unit for 0 commas?
- tup_mod = mkModName "GHC.Tuple"
+ tup_mod | n_commas ==0 = mkModName "GHC.Unit"
+ | otherwise = mkModName "GHC.Tuple"
+ -- Oddly () is in a different module than the other tuples
-- Unboxed tuple data and type constructors
unboxedTupleDataName :: Int -> Name -- ^ Data constructor
More information about the Cvs-libraries
mailing list