[Git][ghc/ghc][wip/T21623] Wibble

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Aug 24 23:27:31 UTC 2022



Simon Peyton Jones pushed to branch wip/T21623 at Glasgow Haskell Compiler / GHC


Commits:
84e9968c by Simon Peyton Jones at 2022-08-25T00:27:46+01:00
Wibble

- - - - -


1 changed file:

- compiler/GHC/Tc/Errors/Ppr.hs


Changes:

=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -2183,6 +2183,9 @@ pprTcSolverReportMsg ctxt
     ppr_torc ConstraintLike = text "constraint"
 
     describe_rep :: RuntimeRepType -> Maybe SDoc
+    -- describe_rep IntRep            = Just "an IntRep"
+    -- describe_rep (BoxedRep Lifted) = Just "a lifted"
+    --   etc
     describe_rep rep
       | Just (rr_tc, rr_args) <- splitRuntimeRep_maybe rep
       = case rr_args of
@@ -2192,14 +2195,16 @@ pprTcSolverReportMsg ctxt
                       Lifted   -> Just (text "a lifted")
                       Unlifted -> Just (text "a boxed unlifted")
           [] | rr_tc `hasKey` tupleRepDataConTyConKey -> Just (text "a zero-bit")
-             | starts_with_vowel rr_tc -> Just (text "an" <+> ppr rr_tc)
-             | otherwise               -> Just (text "a"  <+> ppr rr_tc)
+             | starts_with_vowel rr_occ -> Just (text "an" <+> text rr_occ)
+             | otherwise                -> Just (text "a"  <+> text rr_occ)
+             where
+               rr_occ = occNameString (getOccName rr_tc)
+
           _ -> Nothing -- Must be TupleRep [r1..rn]
       | otherwise = Nothing
 
-    starts_with_vowel tc
-      | (c:_) <- occNameString (getOccName tc) = c `elem` "aeiou"
-      | otherwise                              = False
+    starts_with_vowel (c:_) = c `elem` "AEIOU"
+    starts_with_vowel []    = False
 
 pprTcSolverReportMsg _ (FixedRuntimeRepError frr_origs) =
   vcat (map make_msg frr_origs)



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84e9968c34cde243944c2bf71555442b0b4174cb
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/20220824/ea2c769c/attachment-0001.html>


More information about the ghc-commits mailing list