diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-07-22 09:24:40 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-07-23 09:00:07 -0400 |
commit | 19d8c3c24d4610607ee39e9203929a32ed68a7f2 (patch) | |
tree | 66a5561e77bb17f36d744f90f6e21f0a73454ba0 | |
parent | 7757465f855f8bb893aad302f38ebab3c0b8f5e4 (diff) | |
download | haskell-19d8c3c24d4610607ee39e9203929a32ed68a7f2.tar.gz |
Release notes and changelog wibbles
-rw-r--r-- | docs/users_guide/9.4.1-notes.rst | 25 | ||||
-rw-r--r-- | libraries/base/changelog.md | 30 |
2 files changed, 39 insertions, 16 deletions
diff --git a/docs/users_guide/9.4.1-notes.rst b/docs/users_guide/9.4.1-notes.rst index d24e55442a..8673f78a9b 100644 --- a/docs/users_guide/9.4.1-notes.rst +++ b/docs/users_guide/9.4.1-notes.rst @@ -109,9 +109,11 @@ Compiler - The way GHC checks for representation polymorphism has been overhauled: all the checks are now done during typechecking. The error messages now contain more detailed information about the specific check that was performed. + - A new pragma, :pragma:`OPAQUE`, that ensures that every call of a named function annotated with an :pragma:`OPAQUE` pragma remains a call of that named function, - not some name-mangled variant. + not some name-mangled variant. This implements GHC Proposal `#415 + <https://github.com/ghc-proposals/ghc-proposals/pull/415>`_. - The parsing of implicit parameters is slightly more permissive, as GHC now allows :: @@ -228,30 +230,21 @@ Runtime system ``base`` library ~~~~~~~~~~~~~~~~ +- ``GHC.Generics`` now provides a set of newtypes, ``Generically`` and + ``Generically1``, for deriving generic instances via :lang-ext:`DerivingVia`. + ``Generically`` instances include ``Semigroup`` and ``Monoid``. + - There's a new special function ``withDict`` in ``GHC.Exts``: :: withDict :: forall {rr :: RuntimeRep} st dt (r :: TYPE rr). st -> (dt => r) -> r where ``dt`` must be a class containing exactly one method, whose type - must be ``st``. - - This function converts ``st`` to a type class dictionary. + must be ``st``. This function converts ``st`` to a type class dictionary. It removes the need for ``unsafeCoerce`` in implementation of reflection libraries. It should be used with care, because it can introduce incoherent instances. - For example, the ``withTypeable`` function from the - ``Data.Typeable`` module can now be defined as: :: - - withTypeable :: forall k (a :: k) rep (r :: TYPE rep). () - => TypeRep a -> (Typeable a => r) -> r - withTypeable rep k = withDict @(TypeRep a) @(Typeable a) rep k - - Note that the explicit type applications are required, as the call to - ``withDict`` would be ambiguous otherwise. - - This replaces the old ``GHC.Exts.magicDict``, which required - an intermediate data type and was less reliable. +- See the the ``base`` library's ``changelog.md`` for a full accounting. ``ghc-prim`` library ~~~~~~~~~~~~~~~~~~~~ diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 3c9e605ae0..15786e9b83 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -48,6 +48,36 @@ * Re-export the `IsList` typeclass from the new `GHC.IsList` module. + * There's a new special function ``withDict`` in ``GHC.Exts``: :: + + withDict :: forall {rr :: RuntimeRep} st dt (r :: TYPE rr). st -> (dt => r) -> r + + where ``dt`` must be a class containing exactly one method, whose type + must be ``st``. + + This function converts ``st`` to a type class dictionary. + It removes the need for ``unsafeCoerce`` in implementation of reflection + libraries. It should be used with care, because it can introduce + incoherent instances. + + For example, the ``withTypeable`` function from the + ``Data.Typeable`` module can now be defined as: :: + + withTypeable :: forall k (a :: k) rep (r :: TYPE rep). () + => TypeRep a -> (Typeable a => r) -> r + withTypeable rep k = withDict @(TypeRep a) @(Typeable a) rep k + + Note that the explicit type applications are required, as the call to + ``withDict`` would be ambiguous otherwise. + + This replaces the old ``GHC.Exts.magicDict``, which required + an intermediate data type and was less reliable. + + * `Data.Word.Word64` and `Data.Int.Int64` are now already represented by + `Word64#` and `Int64#`, respectively. Previously on 32-bit platforms these + were rather represented by `Word#` and `Int#`. See GHC #11953. + + ## 4.16.1.0 *Feb 2022* * Shipped with GHC 9.2.2 |