Simplify package dump for -v4

Summary:
Previously, on -v4  and greater, we dumped out the entire package
database, including lots of metadata that GHC doesn't really care about,
and is guaranteed to correspond to the equivalent in the local/global
package databases on disk.  So, to make this output more useful, on -v4
we instead just print package IDs, and the exposed and trusted flags
(E and T, which can be tweaked at runtime).

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: successful validate

Reviewers: simonpj

Subscribers: simonmar, relrod

Differential Revision: https://phabricator.haskell.org/D24
Fix #9047

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

I forgot to amend this to my last commit.

Signed-off-by: Austin Seipp <austin@well-typed.com>
arclint: disable Bad Charset lint rule

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

+ Remove dead code from the DarcsAges
+ Tweak `git config` flags
    * remove --local, it is not a valid flag
    * --get was used in some places, not in others
+ Simplify reading current branch
+ Delete duplicated code in help
sync-all: delete dead code calling gitInitSubmodules

When running './sync-all get', 'git submodule init' has to be (and is
always) executed, since .gitmodules might contain new submodules (see
commit c3db2b). As a result, after cloning the ghc repo and running the
initial './sync-all get', .git/config will always contain some submodule
sections. Therefore it is not needed to check for this on every
subsequent get or pull, and this code can be deleted.
sync-all: die for real when required repo is missing

Since commit 0e17d4, the default "tag" is "-", not "". It is never
undefined.
sync-all: make --no-dph work for all subcommands
sync-all: set and check variable $repo_is_submodule

Not only does this make the code easier to read, it also fixes a bug.

Starting with commits 691c8a and ccce9f, certain subcommands should
behave differently for submodules. This was done by checking, for each
such subcommand:

    $remotepath eq "-"

This commit corrects that to the check:

    $$line{"remotepath"} eq "-".

Because when we have a clone of a local mirror (checked_out_tree=1),
remotepath actually gets set to $$line{"localpath"}.
sync-all: infer remotepath from .gitmodules file

After this commit, running `sync-all remote set-url` works properly for the
haddock package:

    command: ./sync-all -r git://git.haskell.org remote set-url origin
    before: git://git.haskell.org/packages/haddock.git
    after: git://git.haskell.org/haddock.git

By doing the `remotepath` lookup before the `$is_github_repo` check,
running `sync-all remote set-url` now also works properly for submodule
repos on github:

    command: ./sync-all -r git://github.com/ghc remote set-url origin
    before: git://github.com/ghc/packages/binary
    after: git://github.com/ghc/packages-binary

* Relevant prior commits:
4f4357 "Make `sync-all remote set-url` use normalized `/packages/` urls"
34b072 "Convert haddock into a proper submodule (re #8545)"
974a97 "sync-all: Apply submodule url rewriting also to stuff in util/"
Mark T9208 as broken when debugging is on

this seems to be expected, as explained by SPJ in comment 7 of #9208.
More updates to Backpack impl docs.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Fix regression in Data.Fixed Read instance (re #9231)

`convertFixed` operates under the wrong assumption that
`Data.Fixed.resolution` returns a base-10 exponent `e`, whereas it
actually returns the power-of-10 value `10^e`.

So while the code (that was introduced in 5f19f951d8 / #7483) happens to
compute a correct result by coincidence, it allocates huge integer values
in the process (i.e. `10^(10^e)`) which cause long computations which
eventually result in out-of-memory conditions for `e`-values beyond
`Data.Fixed.Milli`.

A proper long-term fix would probably be to extend the `HasResolution`
type-class to have a 2nd method providing the `e` value.

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

Differential Revision: https://phabricator.haskell.org/D25
Minor refactoring of interface to extraTyVarInfo
Comment the expect_broken for Trac #9208
Add Note [Placeholder PatSyn kinds] in TcBinds

This is just documentation for the fix to Trac #9161
Describe signature mini-backpack.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Add more primops for atomic ops on byte arrays

Summary:
Add more primops for atomic ops on byte arrays

Adds the following primops:

 * atomicReadIntArray#
 * atomicWriteIntArray#
 * fetchSubIntArray#
 * fetchOrIntArray#
 * fetchXorIntArray#
 * fetchAndIntArray#

Makes these pre-existing out-of-line primops inline:

 * fetchAddIntArray#
 * casIntArray#
Fixup c1035d51e to behave more like in GHC 7.6

The fix in c1035d51e (addressing #9231) was done under the assumption
that `Data.Fixed` is used only with power-of-10 `resolution`. This
follow-up fixup changes the behavior to be more consistent with the
previous behavior in GHC 7.6

For instance, for the following `B7` resolution

   > data B7
   > instance HasResolution B7 where resolution _ = 128

After this patch, the following behavior is now observable:

   > 1.070 :: Fixed B7
   1.062
   > 1.062 :: Fixed B7
   1.054

   > read "1.070" :: Fixed B7
   1.062
   > read "1.062" :: Fixed B7
   1.054

This doesn't provide the desirable "read . show == id" property
yet (which didn't hold in GHC 7.6 either), but at least `fromRational`
and `read` are consistent.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Convert loose sub-repos into proper submodules (re #8545)

Specifically, the following sub-repos/modules are converted:

 - libffi-tarballs
 - libraries/array
 - libraries/deepseq
 - libraries/directory
 - libraries/dph
 - libraries/filepath
 - libraries/haskell2010
 - libraries/haskell98
 - libraries/hoopl
 - libraries/hpc
 - libraries/old-locale
 - libraries/old-time
 - libraries/parallel
 - libraries/process
 - libraries/stm
 - libraries/unix
 - nofib
 - utils/hsc2hs

N.B. ghc-tarballs is not converted as it will probably be handled
     differently in the future.

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