summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs/Doc.hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2020-04-13 16:29:44 +0300
committerVladislav Zavialov <vlad.z.4096@gmail.com>2020-04-23 17:21:28 +0300
commite21f3023b095d9bbd000330b56aaaa2977134335 (patch)
treee4f66eb46539c3d62b47648297915d19d8105f6a /compiler/GHC/Hs/Doc.hs
parent8ea37b01b6ab16937f7b528b6bbae9fade9f1361 (diff)
downloadhaskell-wip/semigroup-sdoc.tar.gz
Use Semigroup's (<>) for Doc/SDocwip/semigroup-sdoc
Before this patch, Outputable.hs defined its own (<>) which caused conflicts with (Data.Semigroup.<>) and thus led to inconvenience. However, replacing it is not trivial due to a different fixity: http://www.haskell.org/pipermail/libraries/2011-November/017066.html Nevertheless, it is possible to update the pretty-printing code to work with (<>) of a different fixitiy, and that's what this patch implements. Now Doc and SDoc are instances of Semigroup.
Diffstat (limited to 'compiler/GHC/Hs/Doc.hs')
-rw-r--r--compiler/GHC/Hs/Doc.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Hs/Doc.hs b/compiler/GHC/Hs/Doc.hs
index 7da56b1524..104ce57015 100644
--- a/compiler/GHC/Hs/Doc.hs
+++ b/compiler/GHC/Hs/Doc.hs
@@ -126,7 +126,7 @@ instance Binary DeclDocMap where
instance Outputable DeclDocMap where
ppr (DeclDocMap m) = vcat (map pprPair (Map.toAscList m))
where
- pprPair (name, doc) = ppr name Outputable.<> colon $$ nest 2 (ppr doc)
+ pprPair (name, doc) = ppr name <> colon $$ nest 2 (ppr doc)
emptyDeclDocMap :: DeclDocMap
emptyDeclDocMap = DeclDocMap Map.empty
@@ -144,9 +144,9 @@ instance Outputable ArgDocMap where
ppr (ArgDocMap m) = vcat (map pprPair (Map.toAscList m))
where
pprPair (name, int_map) =
- ppr name Outputable.<> colon $$ nest 2 (pprIntMap int_map)
+ ppr name <> colon $$ nest 2 (pprIntMap int_map)
pprIntMap im = vcat (map pprIPair (Map.toAscList im))
- pprIPair (i, doc) = ppr i Outputable.<> colon $$ nest 2 (ppr doc)
+ pprIPair (i, doc) = ppr i <> colon $$ nest 2 (ppr doc)
emptyArgDocMap :: ArgDocMap
emptyArgDocMap = ArgDocMap Map.empty