Commit b0ccba66 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot
Browse files

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]
parent 1033a720
......@@ -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
~~~~~~~~~~~~~~~
......
......@@ -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`.
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment