8.4.1-notes.rst 2.54 KB
Newer Older
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
.. _release-8-4-1:

Release notes for version 8.4.1
===============================

The significant changes to the various parts of the compiler are listed in the
following sections. There have also been numerous bug fixes and performance
improvements over the 8.2.1 release.


Highlights
----------

The highlights, since the 8.2.1 release, are:

-  Many, many bug fixes.

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

Language
~~~~~~~~

Compiler
~~~~~~~~

- Derived ``Functor``, ``Foldable``, and ``Traversable`` instances are now
David Feuer's avatar
David Feuer committed
28 29
  optimized when their last type parameters have phantom roles.
  Specifically, ::
30 31 32 33 34

    fmap _ = coerce
    traverse _ x = pure (coerce x)
    foldMap _ _ = mempty

David Feuer's avatar
David Feuer committed
35 36 37
  These definitions of ``foldMap`` and ``traverse`` are lazier than the ones we
  would otherwise derive, as they may produce results without inspecting their
  arguments at all.
38

David Feuer's avatar
David Feuer committed
39 40
  See also :ref:`deriving-functor`, :ref:`deriving-foldable`, and
  :ref:`deriving-traversable`.
41 42

- Derived ``Functor``, ``Foldable``, ``Traversable``, ``Generic``, and
David Feuer's avatar
David Feuer committed
43 44
  ``Generic1`` instances now have better, and generally better-documented,
  behaviors for types with no constructors. In particular, ::
45

David Feuer's avatar
David Feuer committed
46 47 48 49 50 51 52 53 54 55
      fmap _ x = case x of
      foldMap _ _ = mempty
      traverse _ x = pure (case x of)
      to x = case x of
      to1 x = case x of
      from x = case x of
      from1 x = case x of

  The new behavior generally leads to more useful error messages than the
  old did, and lazier semantics for ``foldMap`` and ``traverse``.
56

David Feuer's avatar
David Feuer committed
57 58 59 60
- Derived ``Foldable`` instances now derive custom definitions for ``null``
  instead of using the default one. This leads to asymptotically better
  performance for recursive types not shaped like cons-lists, and allows ``null``
  to terminate for more (but not all) infinitely large structures.
61 62

- Derived instances for types with no constructors now have appropriate
David Feuer's avatar
David Feuer committed
63 64 65
  arities: they take all their arguments before producing errors. This may not
  be terribly important in practice, but it seems like the right thing to do.
  Previously, we generated ::
66

David Feuer's avatar
David Feuer committed
67
      (==) = error ...
68 69 70

Now we generate ::

David Feuer's avatar
David Feuer committed
71
      _ == _ = error ...
72 73 74 75 76 77 78 79

- Lots of other bugs. See `Trac
   <https://ghc.haskell.org/trac/ghc/query?status=closed&milestone=8.4.1&col=id&col=summary&col=status&col=type&col=priority&col=milestone&col=component&order=priority>`_
   for a complete list.

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

80 81 82
- Function ``hs_add_root()`` was removed. It was a no-op since GHC-7.2.1
  where module initialisation stopped requiring a call to ``hs_add_root()``.

83 84 85 86 87
Template Haskell
~~~~~~~~~~~~~~~~

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