Fix a popular typo
Add release note about new `SomeAsyncException`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Improve list fusion for [n::Integer..m]

enumFromTo for Integers goes via enumDeltaToInteger, which is less
efficient, as the "delta > = 0" check prevents more inlining which is
required for good fusion code. This rule avoids tihs check for the
common case of "delta = 1", makes up_fb visible and hence inlineable,
which greatly improves "length [n:Integer..m]"; even more so with
CallArity enabled. (#8766)

(cherry picked from commit a60eeccf06c28bee3b87c561450320d17c7399e3)
Test case for #8374

(cherry picked from commit d455e2dfb6d1a7b4b22784f0c49178bd346e15e0)
Wrong bug number

the previous commit added a testcase for #8766, not #8374 -- too many
tabs open.

(cherry picked from commit f28ee96d7c246f78d5e8cb9c853f417e54ff3d91)
Fix T8766 numbers.

As Joachim mentioned, the 7.8 branch doesn't have call-arity analysis,
so the numbers here get a bit worse.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Use new bitwise Int# primops in Data.Bits (re #8791)

The new primops (see also #7689) allow to optimize
`instance Bits Int` by allowing to operate directly on Int#
instead of having to convert to Word# and back to Int# again.

Authored-by: Chris Dueck <crdueck@uwaterloo.ca>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 0fc4fb5477d3ca22a8b6894db5b1112b9badfdc4)
Fix typo in documentation of Data.Functor.($>)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 599130f79009c97974ddde4707365afa7b433805)
Tweak Haddock markup in Control.Applicative

This (arguably) improves rendering with Haddock 2.14

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit b3307dc871503ead93771b2096b819273cd129a6)
Minor fixes to Haddock markup

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 6f6f29b34574bc9ed49cc44f0e18596f829c75df)
Add `withMVarMasked` (re #8818)

Like `withMVar`, but the @IO@ action in the second argument is executed
with asynchronous exceptions masked. This completes the `MVar` API,
which already contained `modifyMVarMasked` and `modifyMVarMasked_`.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 2d5471cd3ee42406042a030424a1a83308a170fa)
Provide Typeable1..7 as type synonyms (see #8813)

(cherry picked from commit a5383f7400d05a758094578da28d958fb694b726)
Tweak Haddock markup in Data.Typeable

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit c7e0ea387bc9364bb9af33aec0f710db19765963)
Add new Data.Bits.Bits(zeroBits) method

This adds a new method to `Bits` which completes the Bits API
with a direct way to introduce a value with all bits cleared.

See also original proposal at

  http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/21157

(cherry picked from commit 83bd2f5fc7e4d748ee35911876c1d4239689db0f)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Create Data.Coerce (#8745)

Data.Coerce is a Trustworthy module which safely exports both
`Coercible` and `coerce` for use by users, as it can now be considered
safe under role checking.

See the ticket for details.

Signed-off-by: Austin Seipp <austin@well-typed.com>

(cherry picked from commit f932b79948f0f8e2ac354cdcaea21c5b7c59a27a)
Add some instances for Monoid/Applicative (#8797)

As noted in the ticket, there's no particular reason why there aren't
Generic, Typeable, and Data instances for the types in the
Monoid/Applicative modules.

Furthermore, Product and Sum should also have Num instances as well as
Edward noted.

Aside from that, this patch also changes the dependency chain slightly -
it moves the Monoid Proxy instance into Data.Monoid and out of
Data.Proxy.

Why? Cycles (of course). Monoid depends on Typeable. Typeable uses
Proxy. Proxy uses Monoid. Boom. Luckily, Proxy only depends on Monoid
outside of the GHC namespace, so the fix is easy and clean.

Signed-off-by: Austin Seipp <austin@well-typed.com>

(cherry picked from commit 1a9abe7a1a3c77a028cf23640368cb45527d5834)
Tweak documentation and update changelog.md

This adds release note entries to changelog and tweaks Haddock comments
with respect to the recent commits 1a9abe7a1a3c7 (re #8797) and
f932b79948f0 (re #8745)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 44dec750a618a89202f80dcd695e5eb9fb74a74f)
Tweak Haddock comments in `Data.Ord.Down` added in ebc85262c

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 1dadd50d80240a03c403a07d4374b83cf9da4736)
Workaround failed constant-folding for zeroBits

For some reason GHC fails to constant fold `zeroBits :: Int` and
`zeroBits :: Integer`; `ghc -show-iface` shows

  $fBitsInt_$czeroBits :: GHC.Types.Int
     {- Strictness: m,
        Unfolding: (GHC.Types.I# (GHC.Prim.andI# 1 (GHC.Prim.notI# 1))) -}

Otoh, constant-folding works as expected, reducing `zeroBits` to 0 constant
for the other integer-types (= {Word,Int}{8,16,32,64}` and `Word`). So this
quickfix is actually just treating the symptom rather than the cause.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 2dbfcd70e53845d9119389cecc88411b47b70644)
Fixup release month in changelog

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>