summaryrefslogtreecommitdiff
path: root/docs/users_guide/bugs.rst
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2019-12-04 23:39:28 +1100
committerJosh Meredith <joshmeredith2008@gmail.com>2019-12-04 23:39:28 +1100
commita8435165b84c32fd2ebdd1281dd6ee077e07ad5a (patch)
tree791936d014aeaa26174c2dcbef34c14f3329dd04 /docs/users_guide/bugs.rst
parent7805441b4d5e22eb63a501e1e40383d10380dc92 (diff)
parentf03a41d4bf9418ee028ecb51654c928b2da74edd (diff)
downloadhaskell-wip/binary-readerT.tar.gz
Merge branch 'master' into wip/binary-readerTwip/binary-readerT
Diffstat (limited to 'docs/users_guide/bugs.rst')
-rw-r--r--docs/users_guide/bugs.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst
index c0cffa0ee8..4dc49f0328 100644
--- a/docs/users_guide/bugs.rst
+++ b/docs/users_guide/bugs.rst
@@ -49,6 +49,45 @@ Lexical syntax
reserving ``forall`` as a keyword has significance. For instance, GHC will
not parse the type signature ``foo :: forall x``.
+- The ``(!)`` operator, when written in prefix form (preceded by whitespace
+ and not followed by whitespace, as in ``f !x = ...``), is interpreted as a
+ bang pattern, contrary to the Haskell Report, which prescribes to treat ``!``
+ as an operator regardless of surrounding whitespace. Note that this does not
+ imply that GHC always enables :extension:`BangPatterns`. Without the
+ extension, GHC will issue a parse error on ``f !x``, asking to enable the
+ extension.
+
+- Irrefutable patterns must be written in prefix form::
+
+ f ~a ~b = ... -- accepted by both GHC and the Haskell Report
+ f ~ a ~ b = ... -- accepted by the Haskell Report but not GHC
+
+ When written in non-prefix form, ``(~)`` is treated by GHC as a regular
+ infix operator.
+
+ See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__
+ for the precise rules.
+
+- Strictness annotations in data declarations must be written in prefix form::
+
+ data T = MkT !Int -- accepted by both GHC and the Haskell Report
+ data T = MkT ! Int -- accepted by the Haskell Report but not GHC
+
+ See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__
+ for the precise rules.
+
+- As-patterns must not be surrounded by whitespace::
+
+ f p@(x, y, z) = ... -- accepted by both GHC and the Haskell Report
+ f p @ (x, y, z) = ... -- accepted by the Haskell Report but not GHC
+
+ When surrounded by whitespace, ``(@)`` is treated by GHC as a regular infix
+ operator.
+
+ See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__
+ for the precise rules.
+
+
.. _infelicities-syntax:
Context-free syntax