summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorEric Seidel <gridaphobe@gmail.com>2016-02-06 14:16:53 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-06 08:46:39 -0500
commit38af3d1db2889423a12a2232b9d52181bba23d75 (patch)
treee8ce3c739cc76a2bbd8ce4f6c9f6a43b0d3d0683 /libraries
parent8aa9f35e4c5e14410bc76ab08ef73f1abe700189 (diff)
downloadhaskell-38af3d1db2889423a12a2232b9d52181bba23d75.tar.gz
Add a derived `Show SrcLoc` instance
Test Plan: ``` ghci> import GHC.Stack ghci> SrcLoc "f" "b" "c" 1 2 3 4 SrcLoc {srcLocPackage = "f", srcLocModule = "b", srcLocFile = "c", srcLocStartLine = 1, srcLocStartCol = 2, srcLocEndLine = 3, srcLocEndCol = 4} ``` Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1886 GHC Trac Issues: #11510
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/Show.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/base/GHC/Show.hs b/libraries/base/GHC/Show.hs
index 4322aff2e8..a3807bbf32 100644
--- a/libraries/base/GHC/Show.hs
+++ b/libraries/base/GHC/Show.hs
@@ -52,6 +52,7 @@ module GHC.Show
import GHC.Base
import GHC.List ((!!), foldr1, break)
import GHC.Num
+import GHC.Stack.Types
-- | The @shows@ functions return a function that prepends the
-- output 'String' to an existing 'String'. This allows constant-time
@@ -204,6 +205,8 @@ instance Show TrName where
instance Show Module where
showsPrec _ (Module p m) = shows p . (':' :) . shows m
+deriving instance Show SrcLoc
+
--------------------------------------------------------------
-- Show instances for the first few tuple
--------------------------------------------------------------