@@ -201,14 +201,15 @@ p_match' placer pretty style isInfix strictness m_pats m_grhss = do
201201 else EqualSign
202202 newlineSep (located' (p_grhs' pretty groupStyle)) grhssGRHSs
203203 let whereLocation = combineSrcSpans patGrhssSpan $ getLoc grhssLocalBinds
204− unless
205− (GHC.isEmptyLocalBindsPR (unLoc grhssLocalBinds))
206− (inciLocalBinds . switchLayout whereLocation $ do
207− breakpoint
208− txt "where"
209− breakpoint
210− inci (located grhssLocalBinds p_hsLocalBinds)
211− )
204+ whereIsEmpty = GHC.isEmptyLocalBindsPR (unLoc grhssLocalBinds)
205+ unless (GHC.eqEmptyLocalBinds (unLoc grhssLocalBinds))
206+ . inciLocalBinds
207+ . switchLayout whereLocation $ do
208+ if whereIsEmpty then newline else breakpoint
209+ txt "where"
210+ unless whereIsEmpty $ do
211+ breakpoint
212+ inci (located grhssLocalBinds p_hsLocalBinds)
212213 case style of
213214 Lambda -> placeHanging placement $
214215 switchLayout patGrhssSpan p_body