byteSwap16/32: Narrow the result to 16/32 bits

According to primops.txt.pp, the BSwap16Op and BSwap32Op primops
leave the higher bytes of their results undefined. We must clear
those higher bytes here before storing the result in a Word16/32.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Add Data.Bool.bool (fixes #8302)
Remove Hugs98 specific code

For rationale. see
 http://permalink.gmane.org/gmane.comp.lang.haskell.ghc.devel/2349

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Constant-fold `__GLASGOW_HASKELL__` CPP conditionals

Now that HUGS and NHC specific code has been removed, this commit "folds"
the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`.  This
renders `base` officially GHC only.

This commit also removes redundant `{-# LANGUAGE CPP #-}`.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Make `<Typeable.h>` obsolete and refactor away its use

With GHC 7.8's PolyKinds the macros in `<Typeable.h>` are no longer of any
use, and their use is clearly obsolete. The sites using those macros are
replaced by auto-derivations of `Typeable` instances.

This reduces reliance on the CPP extension and the compile dependency on
`Typeable.h` in a couple of modules.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Replaced Text.Printf with extensible printf, and made comcommitant changes

Signed-off-by: Joachim Breitner <mail@joachim-breitner.de>
Update use of role annotations to new syntax.
Add `{-# MINIMAL #-}` annotations to typeclasses

This makes use of the new `{-# MINIMAL #-}` facility (see #7633)
for the following typeclasses

 - `Bits`
 - `Foldable`
 - `Fractional`
 - `Num`
 - `MonadZip`
 - `Read`
 - `Show`
 - `Storable`
 - `Traversable`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Trailing whitespaces
Follow changes in comparison primops (see #6135)
Add Haddock docs for new `class FiniteBits`
Add Haddock `/Since: 4.7.0.0/` comments to new symbols

These annotations were added in such a way, that the line

{{{
/Since: 4.7.0.0/
}}}

represents the last paragraph of the Haddock comment.

Maybe Haddock will have support for this meta-syntax at some point, and
be able to inherited the since-version property to the children of an
annotated symbol and display the since-version property in the rendered
documentation only in cases when it's not visually obvious (for
instance, when re-exporting documentation strings).

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add Haddock `/Since: 4.6.0.0/` comments to symbols

This commit retroactively adds `/Since: 4.6.0.0/` annotations to symbols
newly added/exposed in `base-4.6.0.0` (as shipped with GHC 7.6.1).

See also 6368362f which adds the respective annotation for symbols newly
added in `base-4.7.0.0` (that goes together with GHC 7.8.1).

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add Haddock `/Since: 4.5.[01].0/` comments to symbols

This commit retroactively adds `/Since: 4.5.[01].0/` annotations to symbols
newly added/exposed in `base-4.5.[01].0` (as shipped with GHC 7.4.[12]).

See also 6368362f which adds the respective annotation for symbols newly
added in `base-4.7.0.0` (that goes together with GHC 7.8.1).

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add Haddock `/Since: 4.4.0.0/` comments to symbols

This commit retroactively adds `/Since: 4.4.0.0/` annotations to symbols
newly added/exposed in `base-4.4.0.0` (as shipped with GHC 7.2.1).

See also 6368362f which adds the respective annotation for symbols newly
added in `base-4.7.0.0` (that goes together with GHC 7.8.1).

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Remove obsolete pre-Haddock-2 `#hide` pragmas

The now obsolete (and redundant) `#hide` pragmas have been superseded by
`{-# OPTIONS_HADDOCK hide #-}` pragmas which are used by most of the
affected modules anyway.

This commit also adds proper `{-# OPTIONS_HADDOCK hide #-}` pragmas to
`GHC.Desugar` and `GHC.IO.Encoding.Iconv` which had only the ineffective
`#hide` annotation.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add instance Monad (WrappedMonad m) to Control.Applicative (#8218)
Add type functions (-) and ToNat1;  Turn FromNat1 into a closed family.
Add Foldable/Traversable instances for 'Const m'

These were proposed a while ago but never went anywhere.

Authored-by: Edward Kmett <ekmett@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Add fmapCoerce to Functor class.

This allows coercions to work under functors that are not locally known.

Authored-by: Edward Kmett <ekmett@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>