Fix #7853
Test fix for #7853
Improve documentation for mkTextEncoding
Add isLeft/isRight
Fix build on Windows
Update parallel IO manager to handle the invalid files in the same way as previous IO manager.

This patch affects the IO manager using kqueue. See issue #7773. If the kqueue backend cannot wait for events on a file, it will simply call the registered callback for the file immediately. This is the behavior of the previous IO manager. This is not ideal, but it is an initial step toward dealing with the problem properly. Ideally, we would use a non-kqueue mechanism for waiting on files (select seems most reliable) that cannot be waited on with kqueue.
Derive Typeable for RealWorld and (->), now that we can
Support for Windows DBCS and new SBCS with MultiByteToWideChar

Because MultiByteToWideChar/WideCharToMultiByte have a rather unhelpful
interface, we have to use a lot of binary searching tricks to get them
to match the iconv-like interface that GHC requires.

Even though the resulting encodings are slow, it does at least mean that we
now support all of Window's code pages. What's more, since these codecs are
basically only used for console output there probably won't be a huge volume
of text to deal with in the common case, so speed is less of a worry.

Note that we will still use GHC's faster table-based custom codec for supported
SBCSs.
Add comprehensive test for codepage encodings+recovery for them
Omit T7773 on Msys

Patch from Andreas Voellmy
Fix build order when building with integer-simple

The problem hasn't shown up with integer-gmp, but I can't see
why it couldn't happen in that case too.
More build ordering fixes
Another build ordering fix
Add an __hsbase_ prefix to the MD5 symbols (#7914)
Merge branch 'master' of http://darcs.haskell.org/packages/base
Add code to convert from representation types, to existentially quantified singletons.

The basic idea is like this:

data SomeSing where SomeSing :: SingI n => Proxy n -> SomeSing

toSing :: Integer -> Maybe SomeSing  -- Maybe, so that we rejetc -ve numbers

The actual implementation is a bit more complicated because `SomeSing`
is actually parameterized by a kind, so we really have something akin
`SomeSing k`.  Also, `toSing` is a bit more general because, depending
on the kind, the representation is different.  For example, we also
support:

toSing :: String -> Maybe (SomeSing (KindParam :: KindIs Symbol))


This change relies on the primitive added to the compiler, which
converts `Sing` values into `SingI` dictionaries.

A nice benefit of this change is that, as far as I can see,
we don't need  `unsafeSinNat` and friends, so I removed them.
Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base
Enable PolyKinds for Control.Category.

This change will allow us to make various new things instances of
Category, such as promoted tuples.

Original discussion from libraries@haskell.org:

  http://www.haskell.org/pipermail/libraries/2012-August/018268.html

Fell off the radar. No complaints in the 2 week period since being
brought up again:

  http://www.haskell.org/pipermail/libraries/2013-May/019845.html

Patch from Edward Kmett (essentially.)

Authored-by: Edward Kmett <ekmett@gmail.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base
Revert "Add code to convert from representation types, to existentially quantified singletons."

This reverts commit f7fb908ad963f7180c30b55fba57a858b0391de4.

It causes a valdiate failure:

*** Core Lint errors : in result of Simplifier ***
<no location info>: Warning:
    In the expression: f_aqM
                         (x_aqF
                          `cast` (GHC.TypeLits.NTCo:SingI[0] <k_aKs> <n_aKt>
                                  :: GHC.TypeLits.SingI k_aKs n_aKt
                                       ~#
                                     GHC.TypeLits.Sing k_aKs n_aKt))
    From-type of Cast differs from type of enclosed expression
    From-type: GHC.TypeLits.SingI k_aKs n_aKt
    Type of enclosed expr: GHC.TypeLits.Sing k_aHe n_aHf
    Actual enclosed expr: x_aqF
    Coercion used in cast: GHC.TypeLits.NTCo:SingI[0] <k_aKs> <n_aKt>
*** Offending Program ***
[...]