on master help sign in
Make rendering of operator patterns consistent with other cases
commita37765cbcb084b2e2dce9a1d99f603a3550aec10 authorMark Karpov <mark.karpov@tweag.io> dateFri 31 Jan 2020, 14:18 (7 years ago) parent34dc1cb
4 files changed+22−16
CHANGELOG.md+4 data/examples/declaration/value/function/pattern/famous-cardano-pattern-out.hs+8−8 data/examples/declaration/value/function/pattern/multiline-case-pattern-out.hs+2−2 src/Ormolu/Printer/Meat/Declaration/Value.hs+8−6
CHANGELOG.md+4
@@ -4,6 +4,10 @@
44 failure, but tries to format all the files. [Issue
55 502](https://github.com/tweag/ormolu/issues/502).
66
7+* Made rendering of pattern matches involving operators consistent with
8+ other cases of rendering of operators. [Issue
9+ 500](https://github.com/tweag/ormolu/issues/500).
10+
711## Ormolu 0.0.3.1
812
913* Fixed rendering of record updates with the record dot preprocessor syntax
data/examples/declaration/value/function/pattern/famous-cardano-pattern-out.hs+8−8
@@ -1,8 +1,8 @@
1−( getNodeSettingsR :<|>
2− getNodeInfoR :<|>
3− getNextUpdateR :<|>
4− restartNodeR
5− ) :<|>
6− ( getUtxoR :<|>
7− getConfirmedProposalsR
8− ) = client nodeV1Api
1+( getNodeSettingsR
2+ :<|> getNodeInfoR
3+ :<|> getNextUpdateR
4+ :<|> restartNodeR
5+ )
6+ :<|> ( getUtxoR
7+ :<|> getConfirmedProposalsR
8+ ) = client nodeV1Api
data/examples/declaration/value/function/pattern/multiline-case-pattern-out.hs+2−2
@@ -10,6 +10,6 @@ f xs = case xs of
1010 ] -> a + b
1111
1212g xs = case xs of
13− ( a :
14− bs
13+ ( a
14+ : bs
1515 ) -> a + b
src/Ormolu/Printer/Meat/Declaration/Value.hs+8−6
@@ -966,12 +966,14 @@ p_pat = \case
966966 case dotdot of
967967 Nothing -> Just <$> fields
968968 Just n -> (Just <$> take n fields) ++ [Nothing]
969− InfixCon x y -> do
970− p_pat x
971− space
972− p_rdrName pat
973− breakpoint
974− inci (p_pat y)
969+ InfixCon l r -> do
970+ switchLayout [getLoc l, getLoc r] $ do
971+ p_pat l
972+ breakpoint
973+ inci $ do
974+ p_rdrName pat
975+ space
976+ p_pat r
975977 ConPatOut {} -> notImplemented "ConPatOut" -- presumably created by renamer?
976978 ViewPat NoExt expr pat -> sitcc $ do
977979 located expr p_hsExpr