[commit: ghc] master: Fix pretty printing of MINIMAL signatures (1ec632f)

git at git.haskell.org git at git.haskell.org
Thu Dec 15 18:07:47 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1ec632f880ab730f99ae9286d5be8e2287330ca4/ghc

>---------------------------------------------------------------

commit 1ec632f880ab730f99ae9286d5be8e2287330ca4
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Thu Dec 15 11:17:34 2016 -0500

    Fix pretty printing of MINIMAL signatures
    
    Reviewers: austin, alanz, bgamari
    
    Reviewed By: alanz, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2836


>---------------------------------------------------------------

1ec632f880ab730f99ae9286d5be8e2287330ca4
 compiler/hsSyn/HsBinds.hs         | 5 +++--
 testsuite/tests/printer/Ppr023.hs | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs
index 5933df8..421a358 100644
--- a/compiler/hsSyn/HsBinds.hs
+++ b/compiler/hsSyn/HsBinds.hs
@@ -972,7 +972,8 @@ ppr_sig (InlineSig var inl)
                                    <+> pprPrefixOcc (unLoc var))
 ppr_sig (SpecInstSig src ty)
   = pragSrcBrackets src "{-# SPECIALISE" (text "instance" <+> ppr ty)
-ppr_sig (MinimalSig _ bf)         = pragBrackets (pprMinimalSig bf)
+ppr_sig (MinimalSig src bf)
+  = pragSrcBrackets src "{-# MINIMAL" (pprMinimalSig bf)
 ppr_sig (PatSynSig names sig_ty)
   = text "pattern" <+> pprVarSig (map unLoc names) (ppr sig_ty)
 ppr_sig (SCCFunSig src fn mlabel)
@@ -1013,7 +1014,7 @@ instance Outputable TcSpecPrag where
 
 pprMinimalSig :: (OutputableBndr name)
               => LBooleanFormula (Located name) -> SDoc
-pprMinimalSig (L _ bf) = text "MINIMAL" <+> ppr (fmap unLoc bf)
+pprMinimalSig (L _ bf) = ppr (fmap unLoc bf)
 
 {-
 ************************************************************************
diff --git a/testsuite/tests/printer/Ppr023.hs b/testsuite/tests/printer/Ppr023.hs
index 7291854..32cb9bb 100644
--- a/testsuite/tests/printer/Ppr023.hs
+++ b/testsuite/tests/printer/Ppr023.hs
@@ -35,3 +35,7 @@ class Foo a where
     baz :: a -> a -> Bool
     quux :: a -> a -> Bool
     {-# MINIMAL bar, (foo, baq | foo, quux) #-}
+
+class Foo2 a where
+  f :: a
+  {-# MiNiMaL f #-}



More information about the ghc-commits mailing list