Move `Maybe`-typedef into GHC.Base

This is preparatory work for reintroducing SPECIALISEs that were lost
in d94de87252d0fe2ae97341d186b03a2fbe136b04

Differential Revision: https://phabricator.haskell.org/D214
Re-add SPECIALISE liftM* pragmas dropped in d94de87252d0fe

They were dropped because `Maybe` wasn't available in GHC.Base, but now
it is thanks to b47521991a7574f4f3554f7c5444a8c60cfe9efd.

Differential Revision: https://phabricator.haskell.org/D215
Typo
Simplify
Typo in comment
Implement `decodeDouble_Int64#` primop

The existing `decodeDouble_2Int#` primop is rather inconvenient to use
(and in fact is not even used by `integer-gmp`) as the mantissa is split
into 3 components which would actually fit in an `Int64#` value.

However, `decodeDouble_Int64#` is to be used by the new `integer-gmp2`
re-implementation (see #9281).

Moreover, `decodeDouble_2Int#` performs direct bit-wise operations on the
IEEE representation which can be replaced by a combination of the
portable standard C99 `scalbn(3)` and `frexp(3)` functions.

Differential Revision: https://phabricator.haskell.org/D160
Remove unnecessary imports in GHC.Event.KQueue to fix compiler warnings.

Summary: The imports of Data.Monoid and Data.Maybe in GHC.Event.KQueue are unnecessary and cause validate to fail.

Test Plan: Validate successfully (though I get some unrelated failures).

Reviewers: austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D217
Comments only: explain checkAxInstCo in OptCoercion
Update haddock submodule for package key fix.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Fix formatting bug in core-spec.
Move (=<<) to GHC.Base

This allows GHC.Stack to avoid importing Control.Monad, and
is preparatory work for implementing #9586

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D221
Move `when` to GHC.Base

This allows several modules to avoid importing Control.Monad and thus break
import cycles that manifest themselves when implementing #9586

Reviewed By: austin, ekmett

Differential Revision: https://phabricator.haskell.org/D222
Move Applicative/MonadPlus into GHC.Base

This is necessary in order to invert the import-dependency between
Data.Foldable and Control.Monad (for addressing #9586)

This also updates the `binary` submodule to qualify a GHC.Base import

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D223
Move Control.Monad.void into Data.Functor

Both modules still export `void`, but `void`'s implementation now lives in
Data.Functor where it actually belongs in (as it doesn't need a Monad context)

The desired side-effect of this is to invert the import-dep
between Control.Monad and Data.Functor.

Reviewed By: ekmett, austin

Differential Revision: https://phabricator.haskell.org/D224
Invert module-dep between Control.Monad and Data.Foldable

This is the last preparation needed before generalizing entities in
Control.Monad conflicting with those from Data.Foldable (re #9586)

Reviewed By: ekmett, austin

Differential Revision: https://phabricator.haskell.org/D225
Generalise Control.Monad.{sequence_,msum,mapM_,forM_}

This finally takes the gloves off, and performs the first actual
generalization in order to implement #9586. This re-exports the
respective definitions for the 4 combinators defined in Data.Foldable.

This way, importing Data.Foldable and Control.Monad unqualified won't bring
conflicting definitions of those 4 entities into scope anymore.

This change seems to have some minor effect on rule-firing, which
causes some wibble in the test-case T4007

Reviewed By: ekmett, austin

Differential Revision: https://phabricator.haskell.org/D226
Revert "Update haddock submodule for package key fix."

This reverts commit a8d7f81d1f6a9ea658c6f1a965bb3e7717b11e40.
Add -fwarn-context-quantification (#4426)

Summary:
This warning (enabled by default) reports places where a context
implicitly binds a type variable, for example

type T a = {-forall m.-} Monad m => a -> m a

Also update Haddock submodule.

Test Plan: validate

Reviewers: hvr, goldfire, simonpj, austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D211

GHC Trac Issues: #4426
Update haddock submodule (miscellaneous fixes)

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Propositional equality for Datatype meta-information