on master help sign in
Fix rendering of type equalities
8c27549mrkkrp
data/examples/declaration/value/function/equality-constraints-out.hsnew file+2
@@ -0,0 +1,2 @@
1+foo :: (a ~ b) => a -> b -> Int
2+foo = undefined
data/examples/declaration/value/function/equality-constraints.hsnew file+2
@@ -0,0 +1,2 @@
1+foo :: (a ~ b) => a -> b -> Int
2+foo = undefined
src/Ormolu/Printer/Meat/Common.hs+9−3
@@ -17,7 +17,6 @@ where
17import Control.Monad
17import Control.Monad
18import Data.List (isPrefixOf)
18import Data.List (isPrefixOf)
19import GHC hiding (GhcPs, IE)
19import GHC hiding (GhcPs, IE)
20−import Module (Module (..))
21import Name (nameStableString)
20import Name (nameStableString)
22import OccName (OccName (..))
21import OccName (OccName (..))
23import Ormolu.Printer.Combinators
22import Ormolu.Printer.Combinators
@@ -65,8 +64,15 @@ p_rdrName l@(L spn _) = located l $ \x -> do
65 (atom occName, False)
64 (atom occName, False)
66 Qual mname occName ->
65 Qual mname occName ->
67 (p_qualName mname occName, False)
66 (p_qualName mname occName, False)
68− Orig (Module _ mname) occName ->
67+ Orig _ occName ->
68+ -- NOTE This is used when GHC generates code that will be fed
69+ -- into the renamer (e.g. from deriving clauses), but where we
70+ -- want to say that something comes from given module which is
71+ -- not specified in the source code, e.g. @Prelude.map@.
72+ --
73+ -- My current understanding is that the provided module name
74+ -- serves no purpose for us and can be safely ignored.
69− (p_qualName mname occName, False)
75+ (atom occName, False)
70 Exact name ->
76 Exact name ->
71 -- NOTE I'm not sure this "stable string" is stable enough, but
77 -- NOTE I'm not sure this "stable string" is stable enough, but
72 -- it looks like this is the most robust way to tell if we're
78 -- it looks like this is the most robust way to tell if we're