[Git][ghc/ghc][wip/backport-9.0-linear-types-syntax] Fix pretty-printing of the mult-polymorphic arrow

Vladislav Zavialov gitlab at gitlab.haskell.org
Thu Oct 1 22:40:08 UTC 2020



Vladislav Zavialov pushed to branch wip/backport-9.0-linear-types-syntax at Glasgow Haskell Compiler / GHC


Commits:
d5e13ceb by Vladislav Zavialov at 2020-10-02T01:39:25+03:00
Fix pretty-printing of the mult-polymorphic arrow

(cherry-picked from a8018c17747342444c67eeec21a506c89c1110e8)

- - - - -


6 changed files:

- compiler/GHC/Utils/Outputable.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
- testsuite/tests/linear/should_fail/LinearPartialSig.stderr
- testsuite/tests/linear/should_fail/LinearVar.stderr
- testsuite/tests/roles/should_compile/Roles13.stderr
- testsuite/tests/simplCore/should_compile/T4201.stdout


Changes:

=====================================
compiler/GHC/Utils/Outputable.hs
=====================================
@@ -677,7 +677,7 @@ lbrace     = docToSDoc $ Pretty.lbrace
 rbrace     = docToSDoc $ Pretty.rbrace
 
 mulArrow :: SDoc -> SDoc
-mulArrow d = text "#" <+> d <+> arrow
+mulArrow d = text "%" <> d <+> arrow
 
 
 forAllLit :: SDoc


=====================================
testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
=====================================
@@ -5,15 +5,15 @@ LinearErrOrigin.hs:7:7: error:
         the type signature for:
           foo :: forall a b (p :: GHC.Types.Multiplicity)
                         (q :: GHC.Types.Multiplicity).
-                 (a # p -> b) -> a # q -> b
+                 (a %p -> b) -> a %q -> b
         at LinearErrOrigin.hs:6:1-31
       ‘q’ is a rigid type variable bound by
         the type signature for:
           foo :: forall a b (p :: GHC.Types.Multiplicity)
                         (q :: GHC.Types.Multiplicity).
-                 (a # p -> b) -> a # q -> b
+                 (a %p -> b) -> a %q -> b
         at LinearErrOrigin.hs:6:1-31
     • In an equation for ‘foo’: foo f x = f x
     • Relevant bindings include
-        f :: a # p -> b (bound at LinearErrOrigin.hs:7:5)
-        foo :: (a # p -> b) -> a # q -> b (bound at LinearErrOrigin.hs:7:1)
+        f :: a %p -> b (bound at LinearErrOrigin.hs:7:5)
+        foo :: (a %p -> b) -> a %q -> b (bound at LinearErrOrigin.hs:7:1)


=====================================
testsuite/tests/linear/should_fail/LinearPartialSig.stderr
=====================================
@@ -3,5 +3,5 @@ LinearPartialSig.hs:5:9: error:
     • Found type wildcard ‘_’
         standing for ‘'Many :: GHC.Types.Multiplicity’
       To use the inferred type, enable PartialTypeSignatures
-    • In the type ‘a # _ -> a’
-      In the type signature: f :: a # _ -> a
+    • In the type ‘a %_ -> a’
+      In the type signature: f :: a %_ -> a


=====================================
testsuite/tests/linear/should_fail/LinearVar.stderr
=====================================
@@ -1,13 +1,13 @@
 
 LinearVar.hs:5:5: error:
     • Couldn't match type ‘m’ with ‘'Many’
-      Expected: a # m -> b
+      Expected: a %m -> b
         Actual: a -> b
       ‘m’ is a rigid type variable bound by
         the type signature for:
-          f :: forall a b (m :: GHC.Types.Multiplicity). a # m -> b
+          f :: forall a b (m :: GHC.Types.Multiplicity). a %m -> b
         at LinearVar.hs:4:1-14
     • In the expression: undefined :: a -> b
       In an equation for ‘f’: f = undefined :: a -> b
     • Relevant bindings include
-        f :: a # m -> b (bound at LinearVar.hs:5:1)
+        f :: a %m -> b (bound at LinearVar.hs:5:1)


=====================================
testsuite/tests/roles/should_compile/Roles13.stderr
=====================================
@@ -14,7 +14,7 @@ convert :: Wrap Age -> Int
 convert
   = convert1
     `cast` (<Wrap Age>_R
-            # <'Many>_N ->_R Roles13.N:Wrap[0] (Roles13.N:Age[0])
+            %<'Many>_N ->_R Roles13.N:Wrap[0] (Roles13.N:Age[0])
             :: (Wrap Age -> Wrap Age) ~R# (Wrap Age -> Int))
 
 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}


=====================================
testsuite/tests/simplCore/should_compile/T4201.stdout
=====================================
@@ -1,4 +1,4 @@
   [HasNoCafRefs, LambdaFormInfo: LFReEntrant 1, Arity: 1,
    Strictness: <S,1*U>,
    Unfolding: InlineRule (0, True, True)
-              bof `cast` (Sym (N:Foo[0]) # <'Many>_N ->_R <T>_R)]
+              bof `cast` (Sym (N:Foo[0]) %<'Many>_N ->_R <T>_R)]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d5e13cebc969f9820b6b9437afe0699e15bbc2ff

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d5e13cebc969f9820b6b9437afe0699e15bbc2ff
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201001/ec6f52a5/attachment-0001.html>


More information about the ghc-commits mailing list