summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2020-10-02 19:32:37 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-03 19:33:02 -0400
commitb0ccba66c4d7c16eba7e2fdc1857fc0f63cd33f9 (patch)
treed66672a90944b78e19f2fdb16d83ee3fa529230b
parent1033a720abf4a23a30c5cb0dfcb18b2bae3acc68 (diff)
downloadhaskell-b0ccba66c4d7c16eba7e2fdc1857fc0f63cd33f9.tar.gz
Small documentation fixes
- Fix formatting of code blocks and a few sphinx warnings - Move the Void# change to 9.2, it was done right after the branch was cut - Fix typo in linear types documentation - Note that -Wincomplete-uni-patterns affects lazy patterns [skip ci]
-rw-r--r--docs/users_guide/9.0.1-notes.rst5
-rw-r--r--docs/users_guide/9.2.1-notes.rst14
-rw-r--r--docs/users_guide/exts/deriving_extra.rst2
-rw-r--r--docs/users_guide/exts/gadt_syntax.rst4
-rw-r--r--docs/users_guide/exts/instances.rst4
-rw-r--r--docs/users_guide/exts/linear_types.rst2
-rw-r--r--docs/users_guide/using-warnings.rst8
7 files changed, 25 insertions, 14 deletions
diff --git a/docs/users_guide/9.0.1-notes.rst b/docs/users_guide/9.0.1-notes.rst
index cee0e1a7ed..8db76e7cf3 100644
--- a/docs/users_guide/9.0.1-notes.rst
+++ b/docs/users_guide/9.0.1-notes.rst
@@ -193,7 +193,7 @@ Language
* GHC more strictly enforces the rule that the type in the top of an instance
declaration is not permitted to contain nested ``forall``\ s or contexts, as
documented in :ref:`formal-instance-syntax`. For example, the following
- examples, which previous versions of GHC would accept, are now rejected:
+ examples, which previous versions of GHC would accept, are now rejected: ::
instance (forall a. C a) where ...
instance (Show a => C a) where ...
@@ -349,9 +349,6 @@ Haddock
- Add a known-key ``cstringLength#`` to ``GHC.CString`` that is eligible
for constant folding by a built-in rule.
-- ``Void#`` is now a type synonym for the unboxed tuple ``(# #)``.
- Code using ``Void#`` now has to enable :extension:`UnboxedTuples`.
-
``ghc`` library
~~~~~~~~~~~~~~~
diff --git a/docs/users_guide/9.2.1-notes.rst b/docs/users_guide/9.2.1-notes.rst
index 516bf36563..f8e9853e8f 100644
--- a/docs/users_guide/9.2.1-notes.rst
+++ b/docs/users_guide/9.2.1-notes.rst
@@ -11,13 +11,13 @@ Language
impredicative types, as described in in the paper
`A quick look at impredicativity
<https://www.microsoft.com/en-us/research/publication/a-quick-look-at-impredicativity/>`__
- (Serrano et al, ICFP 2020). More information here: :ref:`impredicative-polymorphism`.
- This replaces the old (undefined, flaky) behaviour of the :extension:`ImpredicativeTypes` extension.
+ (Serrano et al, ICFP 2020). More information here: :ref:`impredicative-polymorphism`.
+ This replaces the old (undefined, flaky) behaviour of the :extension:`ImpredicativeTypes` extension.
Compiler
~~~~~~~~
-- New '-Wredundant-bang-patterns' flag that enables checks for "dead" bangs.
+- New ``-Wredundant-bang-patterns`` flag that enables checks for "dead" bangs.
For instance, given this program: ::
f :: Bool -> Bool
@@ -26,4 +26,10 @@ Compiler
GHC would report that the bang on ``x`` is redundant and can be removed
since the argument was already forced in the first equation. For more
- details see :ghc-flag:`-Wredundant-bang-patterns`
+ details see :ghc-flag:`-Wredundant-bang-patterns`.
+
+``ghc-prim`` library
+~~~~~~~~~~~~~~~~~~~~
+
+- ``Void#`` is now a type synonym for the unboxed tuple ``(# #)``.
+ Code using ``Void#`` now has to enable :extension:`UnboxedTuples`.
diff --git a/docs/users_guide/exts/deriving_extra.rst b/docs/users_guide/exts/deriving_extra.rst
index e1d63c4b65..dfbc297016 100644
--- a/docs/users_guide/exts/deriving_extra.rst
+++ b/docs/users_guide/exts/deriving_extra.rst
@@ -233,7 +233,7 @@ simply force the (bottom) value of the argument using
data V a deriving Functor
type role V nominal
-will produce
+will produce ::
instance Functor V where
fmap _ z = case z of
diff --git a/docs/users_guide/exts/gadt_syntax.rst b/docs/users_guide/exts/gadt_syntax.rst
index 970d2fce90..5b0e1631f3 100644
--- a/docs/users_guide/exts/gadt_syntax.rst
+++ b/docs/users_guide/exts/gadt_syntax.rst
@@ -110,7 +110,9 @@ Formal syntax for GADTs
To make more precise what is and what is not permitted inside of a GADT-style
constructor, we provide a BNF-style grammar for GADT below. Note that this
-grammar is subject to change in the future. ::
+grammar is subject to change in the future.
+
+.. code-block:: none
gadt_con ::= conids '::' opt_forall opt_ctxt gadt_body
diff --git a/docs/users_guide/exts/instances.rst b/docs/users_guide/exts/instances.rst
index ac1f59d933..3422e6b3ef 100644
--- a/docs/users_guide/exts/instances.rst
+++ b/docs/users_guide/exts/instances.rst
@@ -106,7 +106,9 @@ Formal syntax for instance declaration types
The top of an instance declaration only permits very specific forms of types.
To make more precise what forms of types are or are not permitted, we provide a
-BNF-style grammar for the tops of instance declarations below: ::
+BNF-style grammar for the tops of instance declarations below.
+
+.. code-block:: none
inst_top ::= 'instance' opt_forall opt_ctxt inst_head opt_where
diff --git a/docs/users_guide/exts/linear_types.rst b/docs/users_guide/exts/linear_types.rst
index b34dd2631e..d868adf3f0 100644
--- a/docs/users_guide/exts/linear_types.rst
+++ b/docs/users_guide/exts/linear_types.rst
@@ -90,7 +90,7 @@ therefore constructors appear to have regular function types.
::
- mkList :: [a] -> [MkT1 a]
+ mkList :: [a] -> [T1 a]
mkList xs = map MkT1 xs
Hence the linearity of type constructors is invisible when
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 353c1a07ca..acb9303555 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -860,8 +860,8 @@ of ``-W(no-)*``.
.. ghc-flag:: -Wincomplete-uni-patterns
- :shortdesc: warn when a pattern match in a lambda expression or
- pattern binding could fail
+ :shortdesc: warn when a pattern match in a lambda expression,
+ pattern binding or a lazy pattern could fail
:type: dynamic
:reverse: -Wno-incomplete-uni-patterns
:category:
@@ -874,6 +874,10 @@ of ``-W(no-)*``.
h = \[] -> 2
Just k = f y
+ Furthermore, this flag also applies to lazy patterns, since they are
+ syntactic sugar for pattern bindings. For example, ``f ~(Just x) = (x,x)``
+ is equivalent to ``f y = let Just x = y in (x,x)``.
+
.. ghc-flag:: -fmax-pmcheck-models=⟨n⟩
:shortdesc: soft limit on the number of parallel models the pattern match
checker should check a pattern match clause against