@@ -14,7 +14,7 @@ import Bag (bagToList)
14import BasicTypes
14import BasicTypes
15import Control.Monad
15import Control.Monad
16import Data.Bool (bool)
16import Data.Bool (bool)
17−import Data.Char (isAlphaNum)
17+import Data.Char (isPunctuation)
18import Data.Data hiding (Infix, Prefix)
18import Data.Data hiding (Infix, Prefix)
19import Data.List (intersperse, sortOn)
19import Data.List (intersperse, sortOn)
20import Data.Text (Text)
20import Data.Text (Text)
@@ -810,7 +810,7 @@ p_hsBracket = \case
810 -- turn makes it impossible to detect if there are parentheses around
810 -- turn makes it impossible to detect if there are parentheses around
811 -- it, etc. So we have to add parentheses manually assuming they are
811 -- it, etc. So we have to add parentheses manually assuming they are
812 -- necessary for all operators.
812 -- necessary for all operators.
813− let isOperator = not (any isAlphaNum (showOutputable name))
813+ let isOperator = any isPunctuation (showOutputable name)
814 wrapper = if isOperator then parens else id
814 wrapper = if isOperator then parens else id
815 wrapper $ p_rdrName (noLoc name)
815 wrapper $ p_rdrName (noLoc name)
816 TExpBr NoExt expr -> do
816 TExpBr NoExt expr -> do