summaryrefslogtreecommitdiff
path: root/docs/users_guide/8.10.1-notes.rst
blob: 3086bf411b9bce35b0285cacdfb3c80e5fb3e1b0 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.. _release-8-10-1:

Release notes for version 8.10.1
===============================

The significant changes to the various parts of the compiler are listed in the
following sections.


Highlights
----------

Full details
------------

Language
~~~~~~~~

- Kind variables are no longer implicitly quantified when an explicit ``forall`` is used, see
  `GHC proposal #24
  <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0024-no-kind-vars.rst>`__.
  :ghc-flag:`-Wimplicit-kind-vars` is now obsolete.

- Kind variables are no longer implicitly quantified in constructor declarations: ::

    data T a        = T1 (S (a :: k) | forall (b::k). T2 (S b)  -- no longer accepted
    data T (a :: k) = T1 (S (a :: k) | forall (b::k). T2 (S b)  -- still accepted

- Implicitly quantified kind variables are no longer put in front of other variables: ::

    f :: Proxy (a :: k) -> Proxy (b :: j)

    ghci> :t +v f   -- old order:
    f :: forall k j (a :: k) (b :: j). Proxy a -> Proxy b

    ghci> :t +v f   -- new order:
    f :: forall k (a :: k) j (b :: j). Proxy a -> Proxy b

  This is a breaking change for users of :extension:`TypeApplications`.

- In type synonyms and type family equations, free variables on the RHS are no longer
  implicitly quantified unless used in an outermost kind annotation: ::

    type T = Just (Nothing :: Maybe a)         -- no longer accepted
    type T = Just Nothing :: Maybe (Maybe a)   -- still accepted

- GHC now parses visible, dependent quantifiers (as proposed in
  `GHC proposal 35
  <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0035-forall-arrow.rst>`__),
  such as the following: ::

    data Proxy :: forall k -> k -> Type

  See the `section on explicit kind quantification
  <#explicit-kind-quantification>`__ for more details.

Compiler
~~~~~~~~

- Add new flags :ghc-flag:`-Wunused-record-wildcards` and
  :ghc-flag:`-Wredundant-record-wildcards`  which warn users when they have
  redundant or unused uses of a record wildcard match.

- Calls to `memset` and `memcpy` are now unrolled more aggressively
  and the produced code is more efficient on `x86_64` with added
  support for 64-bit `MOV`s. In particular, `setByteArray#` and
  `copyByteArray#` calls that were not optimized before, now will
  be. See :ghc-ticket:`16052`.
- GHC's runtime linker no longer uses global state. This allows programs
  that use the GHC API to safely use multiple GHC sessions in a single 
  process, as long as there are no native dependencies that rely on
  global state.

Runtime system
~~~~~~~~~~~~~~

Template Haskell
~~~~~~~~~~~~~~~~

- The ``Lift`` typeclass is now levity-polymorphic and has a ``liftTyped``
  method. Previously disallowed instances for unboxed tuples, unboxed sums, an
  primitive unboxed types have also been added. Finally, the code generated by
  :ghc-flags:`-XDeriveLift` has been simplified to take advantage of expression
  quotations.

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

- Add new `bitReverse#` primops that, for a `Word` of 8, 16, 32 or 64 bits,
  reverse the order of its bits e.g. `0b110001` becomes `0b100011`.
  These primitives use optimized machine instructions when available.

``ghc`` library
~~~~~~~~~~~~~~~

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

Build system
~~~~~~~~~~~~

Included libraries
------------------

The package database provided with this distribution also contains a number of
packages other than GHC itself. See the changelogs provided with these packages
for further change information.

.. ghc-package-list::

    libraries/array/array.cabal:             Dependency of ``ghc`` library
    libraries/base/base.cabal:               Core library
    libraries/binary/binary.cabal:           Dependency of ``ghc`` library
    libraries/bytestring/bytestring.cabal:   Dependency of ``ghc`` library
    libraries/Cabal/Cabal/Cabal.cabal:       Dependency of ``ghc-pkg`` utility
    libraries/containers/containers.cabal:   Dependency of ``ghc`` library
    libraries/deepseq/deepseq.cabal:         Dependency of ``ghc`` library
    libraries/directory/directory.cabal:     Dependency of ``ghc`` library
    libraries/filepath/filepath.cabal:       Dependency of ``ghc`` library
    compiler/ghc.cabal:                      The compiler itself
    libraries/ghci/ghci.cabal:               The REPL interface
    libraries/ghc-boot/ghc-boot.cabal:       Internal compiler library
    libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library
    libraries/ghc-compact/ghc-compact.cabal: Core library
    libraries/ghc-heap/ghc-heap.cabal:       GHC heap-walking library
    libraries/ghc-prim/ghc-prim.cabal:       Core library
    libraries/haskeline/haskeline.cabal:     Dependency of ``ghci`` executable
    libraries/hpc/hpc.cabal:                 Dependency of ``hpc`` executable
    libraries/integer-gmp/integer-gmp.cabal: Core library
    libraries/libiserv/libiserv.cabal:       Internal compiler library
    libraries/mtl/mtl.cabal:                 Dependency of ``Cabal`` library
    libraries/parsec/parsec.cabal:           Dependency of ``Cabal`` library
    libraries/pretty/pretty.cabal:           Dependency of ``ghc`` library
    libraries/process/process.cabal:         Dependency of ``ghc`` library
    libraries/stm/stm.cabal:                 Dependency of ``haskeline`` library
    libraries/template-haskell/template-haskell.cabal:     Core library
    libraries/terminfo/terminfo.cabal:       Dependency of ``haskeline`` library
    libraries/text/text.cabal:               Dependency of ``Cabal`` library
    libraries/time/time.cabal:               Dependency of ``ghc`` library
    libraries/transformers/transformers.cabal: Dependency of ``ghc`` library
    libraries/unix/unix.cabal:               Dependency of ``ghc`` library
    libraries/Win32/Win32.cabal:             Dependency of ``ghc`` library
    libraries/xhtml/xhtml.cabal:             Dependency of ``haddock`` executable