Fix printing of backticks around wildcards in operator position
commita7265df09eebfbbc9f0235da03b0837afe922b56
authorwaddlaw <ingronze@gmail.com>
dateThu 11 Jul 2019, 12:27 (7 years ago)
parent9e880c5
data/examples/declaration/value/function/typed-hole-out.hsnew file+5
@@ -0,0 +1,5 @@
1+foo = 1 `_` 2
2+
3+bar = 1 `_a` 2
4+
5+baz = _ `something` _
data/examples/declaration/value/function/typed-hole.hsnew file+5
@@ -0,0 +1,5 @@
1+foo = 1 `_` 2
2+
3+bar = 1 `_a` 2
4+
5+baz = _ `something` _
src/Ormolu/Printer/Meat/Declaration/Value.hs+4−1
@@ -432,7 +432,10 @@ p_hsExpr = \case
432432 OpApp NoExt x op y -> do
433433 located x p_hsExpr
434434 space
435− located op p_hsExpr
435+ let opWrapper = case unLoc op of
436+ EWildPat NoExt -> backticks
437+ _ -> id
438+ located op (opWrapper . p_hsExpr)
436439 placeHanging (exprPlacement (unLoc y)) $
437440 located y p_hsExpr
438441 NegApp NoExt e _ -> do