[Git][ghc/ghc][master] Fix ambiguous syntax of BangPatterns in users guide
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 56ada7c0 by Mrjtjmn at 2026-05-23T18:44:19-04:00 Fix ambiguous syntax of BangPatterns in users guide Update documentation for the BangPatterns extension to specify how surrounding whitespace affects interpretation of `!`. * Only when there is whitespace before `!` and no whitespace after, it is recognized as a BangPattern. * Other cases `⟨varid⟩!⟨varid⟩`, `⟨varid⟩ ! ⟨varid⟩`, `⟨varid⟩! ⟨varid⟩` are treated as infix operators. - - - - - 1 changed file: - docs/users_guide/exts/stolen_syntax.rst Changes: ===================================== docs/users_guide/exts/stolen_syntax.rst ===================================== @@ -50,7 +50,7 @@ The following syntax is stolen: Stolen by: :extension:`Arrows` -``?varid`` +``?⟨varid⟩`` .. index:: single: implicit parameters @@ -77,17 +77,20 @@ The following syntax is stolen: Stolen by: :extension:`QuasiQuotes` -⟨varid⟩``#``, ⟨char⟩``#``, ⟨string⟩``#``, ⟨integer⟩``#``, ⟨float⟩``#``, ⟨float⟩``##`` +``⟨varid⟩#``, ``⟨char⟩#``, ``⟨string⟩#``, ``⟨integer⟩#``, ``⟨float⟩#``, ``⟨float⟩##`` Stolen by: :extension:`MagicHash` -⟨integer⟩, ``#(Int|Word)(8|16|32|64)?`` +``⟨integer⟩#(Int|Word)(8|16|32|64)?`` Stolen by: :extension:`ExtendedLiterals` ``(#``, ``#)`` Stolen by: :extension:`UnboxedTuples` -⟨varid⟩, ``!``, ⟨varid⟩ - Stolen by: :extension:`BangPatterns` +``⟨varid⟩ !⟨varid⟩`` + Stolen by: :extension:`BangPatterns`. Only when there are whitespaces before + ``!`` and no whitespace after ``!``, it is interpreted as :extension:`BangPatterns`. Other + cases such as ``⟨varid⟩!⟨varid⟩``, ``⟨varid⟩ ! ⟨varid⟩``, and ``⟨varid⟩! ⟨varid⟩``, are + interpreted as infix operators. ``pattern`` Stolen by: :extension:`PatternSynonyms` View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56ada7c0b3d9ff67fe0fa9999cd9d4e3... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56ada7c0b3d9ff67fe0fa9999cd9d4e3... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)