summaryrefslogtreecommitdiff
path: root/docs/users_guide/9.2.1-notes.rst
blob: b691fc05376b9d05dcc1ad0969a4ac4250d1f5b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.. _release-9-2-1:

Version 9.2.1
==============

Language
~~~~~~~~

* :extension:`ImpredicativeTypes`: Finally, polymorphic types have become first class!
  GHC 9.2 includes a full implementation of the Quick Look approach to type inference for
  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.

Compiler
~~~~~~~~

- New ``-Wredundant-bang-patterns`` flag that enables checks for "dead" bangs.
  For instance, given this program: ::

      f :: Bool -> Bool
      f True = False
      f !x   = x

  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`.

- New ``-finline-generics`` and ``-finline-generics-aggressively`` flags for
  improving performance of generics-based algorithms.

  For more details see :ghc-flag:`-finline-generics` and
  :ghc-flag:`-finline-generics-aggressively`.

- Type checker plugins which work with the natural numbers now
  should use ``naturalTy`` kind instead of ``typeNatKind``, which has been removed.

``ghc-prim`` library
~~~~~~~~~~~~~~~~~~~~

- ``Void#`` is now a type synonym for the unboxed tuple ``(# #)``.
  Code using ``Void#`` now has to enable :extension:`UnboxedTuples`.

``base`` library
~~~~~~~~~~~~~~~~

- It's possible now to promote the ``Natural`` type: :: 
    
    data Coordinate = Mk2D Natural Natural
    type MyCoordinate = Mk2D 1 10
    
  The separate kind ``Nat`` is removed and now it is just a type synonym for
  ``Natural``. As a consequence, one must enable ``TypeSynonymInstances``
  in order to define instances for ``Nat``.