1
1
mirror of https://github.com/google/ormolu.git synced 2024-12-02 23:43:34 +03:00

Support single line where clauses

This commit is contained in:
Basile Henry 2019-07-13 18:13:18 +01:00 committed by Mark Karpov
parent 0baa898f30
commit b2f49a7693
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,5 @@
foo :: Int -> Int
foo x = f x
where
f z = z
foo x = f x where f z = z
bar :: Int -> Int
bar x = f x

View File

@ -200,11 +200,13 @@ p_match' placer pretty style isInfix strictness m_pats m_grhss = do
then RightArrow
else EqualSign
newlineSep (located' (p_grhs' pretty groupStyle)) grhssGRHSs
let whereLocation = combineSrcSpans patGrhssSpan $ getLoc grhssLocalBinds
unless
(GHC.isEmptyLocalBindsPR (unLoc grhssLocalBinds))
(inciLocalBinds $ do
newline
line (txt "where")
(inciLocalBinds . switchLayout whereLocation $ do
breakpoint
txt "where"
breakpoint
inci (located grhssLocalBinds p_hsLocalBinds)
)
case style of