FunDep printer: Fix unicode arrow
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Fri, 20 May 2016 08:39:57 +0000 (04:39 -0400)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Fri, 20 May 2016 08:40:13 +0000 (04:40 -0400)
The arrow should be printed in unicode arrow syntax when
-fprint-unicode-syntax is used.

Reviewers: austin, bgamari, thomie

Reviewed By: thomie

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2243

GHC Trac Issues: #11825

compiler/types/Class.hs
testsuite/tests/ghci/should_run/T11825.hs [new file with mode: 0644]
testsuite/tests/ghci/should_run/T11825.script [new file with mode: 0644]
testsuite/tests/ghci/should_run/T11825.stdout [new file with mode: 0644]
testsuite/tests/ghci/should_run/all.T

index 09c8da9..d62f90f 100644 (file)
@@ -308,7 +308,7 @@ pprFundeps []  = empty
 pprFundeps fds = hsep (vbar : punctuate comma (map pprFunDep fds))
 
 pprFunDep :: Outputable a => FunDep a -> SDoc
-pprFunDep (us, vs) = hsep [interppSP us, text "->", interppSP vs]
+pprFunDep (us, vs) = hsep [interppSP us, arrow, interppSP vs]
 
 instance Data.Data Class where
     -- don't traverse?
diff --git a/testsuite/tests/ghci/should_run/T11825.hs b/testsuite/tests/ghci/should_run/T11825.hs
new file mode 100644 (file)
index 0000000..c3dd32e
--- /dev/null
@@ -0,0 +1,4 @@
+{-# LANGUAGE FunctionalDependencies #-}
+
+class X a b | a -> b where
+  to :: a -> b
diff --git a/testsuite/tests/ghci/should_run/T11825.script b/testsuite/tests/ghci/should_run/T11825.script
new file mode 100644 (file)
index 0000000..7c9d10a
--- /dev/null
@@ -0,0 +1,3 @@
+:set -fprint-unicode-syntax
+:load T11825.hs
+:info X
diff --git a/testsuite/tests/ghci/should_run/T11825.stdout b/testsuite/tests/ghci/should_run/T11825.stdout
new file mode 100644 (file)
index 0000000..9ab7b1b
--- /dev/null
@@ -0,0 +1,4 @@
+class X a b | a → b where
+  to ∷ a → b
+  {-# MINIMAL to #-}
+       -- Defined at T11825.hs:3:1
index 930f14b..08fe33d 100644 (file)
@@ -23,3 +23,4 @@ test('T9915',      just_ghci, ghci_script, ['T9915.script'])
 test('T10145',     just_ghci, ghci_script, ['T10145.script'])
 test('T7253',      just_ghci, ghci_script, ['T7253.script'])
 test('T11328',     just_ghci, ghci_script, ['T11328.script'])
+test('T11825',     just_ghci, ghci_script, ['T11825.script'])