[commit: ghc] master: DsBinds: Avoid using String when desugaring CallStack construction (65bf7ba)
git at git.haskell.org
git at git.haskell.org
Wed Sep 23 09:54:27 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/65bf7baa81772b7f07a4c74d3510dbd2ef03592d/ghc
>---------------------------------------------------------------
commit 65bf7baa81772b7f07a4c74d3510dbd2ef03592d
Author: Ben Gamari <ben at smart-cactus.org>
Date: Wed Sep 23 00:56:03 2015 +0200
DsBinds: Avoid using String when desugaring CallStack construction
Previously CallStacks would be built using String, which would pull in
GHC.Base while compiling GHC.Err. Use [Char] instead.
>---------------------------------------------------------------
65bf7baa81772b7f07a4c74d3510dbd2ef03592d
compiler/deSugar/DsBinds.hs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs
index 6576093..28e866d 100644
--- a/compiler/deSugar/DsBinds.hs
+++ b/compiler/deSugar/DsBinds.hs
@@ -47,7 +47,7 @@ import Type
import Kind (returnsConstraintKind)
import Coercion hiding (substCo)
import TysWiredIn ( eqBoxDataCon, coercibleDataCon, mkListTy
- , mkBoxedTupleTy, stringTy, typeNatKind, typeSymbolKind )
+ , mkBoxedTupleTy, charTy, typeNatKind, typeSymbolKind )
import Id
import MkId(proxyHashId)
import Class
@@ -1023,7 +1023,10 @@ dsEvCallStack cs = do
, return $ mkIntExprInt df (srcSpanEndCol l)
])
- let callSiteTy = mkBoxedTupleTy [stringTy, srcLocTy]
+ -- Be careful to use [Char] instead of String here to avoid
+ -- unnecessary dependencies on GHC.Base, particularly when
+ -- building GHC.Err.absentError
+ let callSiteTy = mkBoxedTupleTy [mkListTy charTy, srcLocTy]
matchId <- newSysLocalDs $ mkListTy callSiteTy
More information about the ghc-commits
mailing list