5 years agoUn-wire `Integer` type (re #9714)
Herbert Valerio Riedel [Mon, 27 Oct 2014 15:44:36 +0000 (16:44 +0100)] 
Un-wire `Integer` type (re #9714)

Integer is currently a wired-in type for integer-gmp. This requires
replicating its inner structure in `TysWiredIn`, which makes it much
harder to change Integer to a more complex representation (as
e.g. needed for implementing #9281)

This commit stops `Integer` being a wired-in type, and makes it
known-key type instead, thereby simplifying code notably.

Reviewed By: austin

Differential Revision:

5 years agoOptimise atomicModifyIORef' implementation (#8345)
David Feuer [Mon, 27 Oct 2014 09:21:20 +0000 (10:21 +0100)] 
Optimise atomicModifyIORef' implementation (#8345)

This forces the new value before installing it in the IORef.

This optimisation was originally suggested by Patrick Palka
and "exhibits a speedup of 1.7x (vanilla RTS) / 1.4x (threaded RTS)"
according to #8345

Reviewed By: austin, simonmar

Differential Revision:

5 years agoAdd new `Data.Bifunctor` module (re #9682)
Herbert Valerio Riedel [Sun, 26 Oct 2014 07:49:38 +0000 (08:49 +0100)] 
Add new `Data.Bifunctor` module (re #9682)

This adds the module `Data.Bifunctor` providing the
`Bifunctor(bimap,first,second)` class and a couple of instances

This module and the class were previously exported by the `bifunctors`
package.  In contrast to the original module all `INLINE` pragmas have
been removed.

Reviewed By: ekmett, austin, dolio

Differential Revision:

5 years agotestsuite: Fix outdated output for T5979/safePkg01
Austin Seipp [Sun, 26 Oct 2014 05:45:56 +0000 (00:45 -0500)] 
testsuite: Fix outdated output for T5979/safePkg01

Looks like it was broken in aa4799534225.

Signed-off-by: Austin Seipp <>
5 years ago`M-x delete-trailing-whitespace` & `M-x untabify`
Herbert Valerio Riedel [Sat, 25 Oct 2014 14:11:21 +0000 (16:11 +0200)] 
`M-x delete-trailing-whitespace` & `M-x untabify`

This removes all remaining tabs from `base`'s source code

5 years agoPass in CXX to libffi's configure script.
Gintautas Miliauskas [Sat, 25 Oct 2014 00:27:05 +0000 (19:27 -0500)] 
Pass in CXX to libffi's configure script.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9720

5 years agofix a typo in comments: normaliseFfiType
Yuras Shumovich [Sat, 25 Oct 2014 00:26:55 +0000 (19:26 -0500)] 
fix a typo in comments: normaliseFfiType

The function is defined in TcForeign module, but misspelled comment
makes it hard to find

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoFix windows build failure.
Austin Seipp [Fri, 24 Oct 2014 22:57:50 +0000 (17:57 -0500)] 
Fix windows build failure.

Authored-by: Simon Marlow <>
Signed-off-by: Austin Seipp <>
5 years agoImplementation of hsig (module signatures), per #9252
Edward Z. Yang [Thu, 7 Aug 2014 17:32:12 +0000 (18:32 +0100)] 
Implementation of hsig (module signatures), per #9252

Module signatures, like hs-boot files, are Haskell modules which omit
value definitions and contain only signatures.  This patchset implements
one particular aspect of module signature, namely compiling them against
a concrete implementation.  It works like this: when we compile an hsig
file, we must be told (via the -sig-of flag) what module this signature
is implementing.  The signature is compiled into an interface file which
reexports precisely the entities mentioned in the signature file.  We also
verify that the interface is compatible with the implementation.

This feature is useful in a few situations:

    1. Like explicit import lists, signatures can be used to reduce
    sensitivity to upstream changes.  However, a signature can be defined
    once and then reused by many modules.

    2. Signatures can be used to quickly check if a new upstream version
    is compatible, by typechecking just the signatures and not the actual

    3. A signature can be used to mediate separate modular development,
    where the signature is used as a placeholder for functionality which
    is loaded in later.  (This is only half useful at the moment, since
    typechecking against signatures without implementations is not implemented
    in this patchset.)

Unlike hs-boot files, hsig files impose no performance overhead.

This patchset punts on the type class instances (and type families) problem:
instances simply leak from the implementation to the signature.  You can
explicitly specify what instances you expect to have, and those will be checked,
but you may get more instances than you asked for.  Our eventual plan is
to allow hiding instances, but to consider all transitively reachable instances
when considering overlap and soundness.

ToDo: signature merging: when a module is provided by multiple signatures
for the same base implementation, we should not consider this ambiguous.

ToDo: at the moment, signatures do not constitute use-sites, so if you
write a signature for a deprecated function, you won't get a warning
when you compile the signature.

Future work: The ability to feed in shaping information so that we can take
advantage of more type equalities than might be immediately evident.

Signed-off-by: Edward Z. Yang <>
Test Plan: validate and new tests

Reviewers: simonpj, simonmar, hvr, austin

Subscribers: simonmar, relrod, ezyang, carter, goldfire

Differential Revision:

GHC Trac Issues: #9252

5 years agoCheck in up-to-date PDF copies of Backpack docs. [skip ci]
Edward Z. Yang [Fri, 24 Oct 2014 01:20:25 +0000 (18:20 -0700)] 
Check in up-to-date PDF copies of Backpack docs. [skip ci]

Signed-off-by: Edward Z. Yang <>
5 years agoMore updates to Backpack manual [skip ci]
Edward Z. Yang [Fri, 24 Oct 2014 01:19:46 +0000 (18:19 -0700)] 
More updates to Backpack manual [skip ci]

Signed-off-by: Edward Z. Yang <>
5 years agoFix a rare parallel GC bug
Simon Marlow [Thu, 23 Oct 2014 10:12:16 +0000 (11:12 +0100)] 
Fix a rare parallel GC bug

When there's a conflict between two threads evacuating the same TSO,
in some cases we would update the incall->tso pointer to point to the
wrong copy of the TSO.  This would get fixed during the next GC, but
if the thread completed in the meantime, it would likely crash.  We're
seeing this about once per day on a heavily loaded machine (it varies
a lot though).

5 years agoAdd forgotten import to T9692
Joachim Breitner [Wed, 22 Oct 2014 13:02:42 +0000 (15:02 +0200)] 
Add forgotten import to T9692


5 years agoFlush stdout in T9692
Joachim Breitner [Wed, 22 Oct 2014 08:49:35 +0000 (10:49 +0200)] 
Flush stdout in T9692

5 years agobase: Mark WCsubst.c as generated for Phabricator
Austin Seipp [Tue, 21 Oct 2014 21:50:23 +0000 (16:50 -0500)] 
base: Mark WCsubst.c as generated for Phabricator

Signed-off-by: Austin Seipp <>
5 years agorts: Detabify Interpreter.c
Austin Seipp [Tue, 21 Oct 2014 21:45:57 +0000 (16:45 -0500)] 
rts: Detabify Interpreter.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Schedule.c
Austin Seipp [Tue, 21 Oct 2014 21:45:19 +0000 (16:45 -0500)] 
[skip ci] rts: Detabify Schedule.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify ProfHeap.c
Austin Seipp [Tue, 21 Oct 2014 21:44:41 +0000 (16:44 -0500)] 
[skip ci] rts: Detabify ProfHeap.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify RetainerProfile.c
Austin Seipp [Tue, 21 Oct 2014 21:44:19 +0000 (16:44 -0500)] 
[skip ci] rts: Detabify RetainerProfile.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify sm/Compact.h
Austin Seipp [Tue, 21 Oct 2014 21:43:04 +0000 (16:43 -0500)] 
[skip ci] rts: Detabify sm/Compact.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify sm/Compact.c
Austin Seipp [Tue, 21 Oct 2014 21:42:49 +0000 (16:42 -0500)] 
[skip ci] rts: Detabify sm/Compact.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify sm/Sanity.c
Austin Seipp [Tue, 21 Oct 2014 21:42:24 +0000 (16:42 -0500)] 
[skip ci] rts: Detabify sm/Sanity.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify sm/GC.c
Austin Seipp [Tue, 21 Oct 2014 21:42:10 +0000 (16:42 -0500)] 
[skip ci] rts: Detabify sm/GC.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify RaiseAsync.c
Austin Seipp [Tue, 21 Oct 2014 21:41:02 +0000 (16:41 -0500)] 
[skip ci] rts: Detabify RaiseAsync.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Capability.c
Austin Seipp [Tue, 21 Oct 2014 21:40:40 +0000 (16:40 -0500)] 
[skip ci] rts: Detabify Capability.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify HeapStackCheck.cmm
Austin Seipp [Tue, 21 Oct 2014 21:39:44 +0000 (16:39 -0500)] 
[skip ci] rts: Detabify HeapStackCheck.cmm

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Exception.cmm
Austin Seipp [Tue, 21 Oct 2014 21:39:15 +0000 (16:39 -0500)] 
[skip ci] rts: Detabify Exception.cmm

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Proftimer.c
Austin Seipp [Tue, 21 Oct 2014 21:38:27 +0000 (16:38 -0500)] 
[skip ci] rts: Detabify Proftimer.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify LdvProfile.h
Austin Seipp [Tue, 21 Oct 2014 21:38:06 +0000 (16:38 -0500)] 
[skip ci] rts: Detabify LdvProfile.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Schedule.h
Austin Seipp [Tue, 21 Oct 2014 21:37:53 +0000 (16:37 -0500)] 
[skip ci] rts: Detabify Schedule.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Stats.c
Austin Seipp [Tue, 21 Oct 2014 21:37:09 +0000 (16:37 -0500)] 
[skip ci] rts: Detabify Stats.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify sm/Scav.c
Austin Seipp [Tue, 21 Oct 2014 21:36:30 +0000 (16:36 -0500)] 
[skip ci] rts: Detabify sm/Scav.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify sm/Evac.c
Austin Seipp [Tue, 21 Oct 2014 21:35:59 +0000 (16:35 -0500)] 
[skip ci] rts: Detabify sm/Evac.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Threads.c
Austin Seipp [Tue, 21 Oct 2014 21:34:07 +0000 (16:34 -0500)] 
[skip ci] rts: Detabify Threads.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Profiling.c
Austin Seipp [Tue, 21 Oct 2014 21:33:46 +0000 (16:33 -0500)] 
[skip ci] rts: Detabify Profiling.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify CheckUnload.c
Austin Seipp [Tue, 21 Oct 2014 21:33:29 +0000 (16:33 -0500)] 
[skip ci] rts: Detabify CheckUnload.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Capability.h
Austin Seipp [Tue, 21 Oct 2014 21:32:58 +0000 (16:32 -0500)] 
[skip ci] rts: Detabify Capability.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify RaiseAsync.h
Austin Seipp [Tue, 21 Oct 2014 21:32:20 +0000 (16:32 -0500)] 
[skip ci] rts: Detabify RaiseAsync.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify RtsMessages.c
Austin Seipp [Tue, 21 Oct 2014 21:31:22 +0000 (16:31 -0500)] 
[skip ci] rts: Detabify RtsMessages.c

Signed-off-by: Austin Seipp <>
5 years agoEnabled warn on tabs by default (fixes #9230)
Mateusz Lenik [Tue, 21 Oct 2014 20:34:00 +0000 (15:34 -0500)] 
Enabled warn on tabs by default (fixes #9230)

This revision enables -fwarn-tabs by default and add a suppression
flag, so that GHC compilation won't fail when some files contain tab

Test Plan: Additional test case, T9230, was added to cover that change.

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter, thomie, mlen

Differential Revision:

GHC Trac Issues: #9230


5 years agoFixes the ARM build
Moritz Angermann [Tue, 21 Oct 2014 20:33:18 +0000 (15:33 -0500)] 
Fixes the ARM build

CodeGen.Platform.hs was changed with the following diff:

    globalRegMaybe _                        = Nothing
   +globalRegMaybe _ = Nothing
   +globalRegMaybe = panic "globalRegMaybe not defined for this platform"

which causes globalRegMaybe ot panic for arch ARM.

This patch ensures globalRegMaybe is not called on ARM.

Signed-off-by: Moritz Angermann <>
Test Plan: Building arm cross-compiler (e.g. --target=arm-apple-darwin10)

Reviewers: hvr, ezyang, simonmar, rwbarton, austin

Reviewed By: austin

Subscribers: dterei, bgamari, simonmar, ezyang, carter

Differential Revision:

GHC Trac Issues: #9593

5 years agoAdd release note about Unicode 7.0
Austin Seipp [Tue, 21 Oct 2014 20:31:57 +0000 (15:31 -0500)] 
Add release note about Unicode 7.0

Signed-off-by: Austin Seipp <>
5 years agoAdd doctest examples for Data.Bool.
Michael Orlitzky [Tue, 21 Oct 2014 20:02:29 +0000 (15:02 -0500)] 
Add doctest examples for Data.Bool.

Add examples for `Data.Bool`, and rework the existing documentation of
the `bool` function slightly: the `a`,`b` in its explanation were changed
to `x`,`y` to avoid ambiguity with the type variable 'a'.

The examples have been tested, and two trailing spaces were removed.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoFix typo in -XConstraintKinds docs
Ricky Elrod [Tue, 21 Oct 2014 20:02:21 +0000 (15:02 -0500)] 
Fix typo in -XConstraintKinds docs

Fix a minor typo that seems to have existed for a long time.

Signed-off-by: Ricky Elrod <>
Test Plan: My eyes.

Reviewers: austin, #ghc

Reviewed By: austin, #ghc

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoAdd doctest examples for Data.Functor.
Michael Orlitzky [Tue, 21 Oct 2014 20:02:11 +0000 (15:02 -0500)] 
Add doctest examples for Data.Functor.

Add doctest examples for the three standalone functions defined in

  * Data.Functor.$>
  * Data.Functor.<$>
  * Data.Functor.void

This is part of a larger plan to add examples for the functions in
base, and to eventually enable automatic testing of them.

Reviewers: austin, hvr, ekmett

Reviewed By: austin

Subscribers: hvr, ekmett, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoMake Data.List.concatMap fuse better
David Feuer [Tue, 21 Oct 2014 20:02:03 +0000 (15:02 -0500)] 
Make Data.List.concatMap fuse better

Fix #9537 precisely as Joachim Breitner proposed in

Reviewers: austin, nomeata

Reviewed By: austin, nomeata

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9537

5 years agoMake findIndices fuse
David Feuer [Tue, 21 Oct 2014 20:01:26 +0000 (15:01 -0500)] 
Make findIndices fuse

Steal the findIndices implementation from Data.Sequence, that can
participate in fold/build fusion

Reviewers: nomeata, austin

Reviewed By: nomeata, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoImprove isDigit, isSpace, etc.
David Feuer [Tue, 21 Oct 2014 20:01:14 +0000 (15:01 -0500)] 
Improve isDigit, isSpace, etc.

Make things less branchy; use unsigned comparisons for range checking.
Eliminate non-spaces more quickly in common cases in isSpace.

Reviewers: ekmett, carter, austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #1473

5 years agoRemove extra period
Matt Kraai [Tue, 21 Oct 2014 20:00:51 +0000 (15:00 -0500)] 
Remove extra period

The documentation has an extra period, which is rendered as

> However, GHCi also has support for interactively loading compiled
> code, as well as supporting all[2] the language extensions that GHC
> provides. .

Removing the extra period should fix this problem.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoUpdate to Unicode version 7.0
David Feuer [Tue, 21 Oct 2014 20:00:33 +0000 (15:00 -0500)] 
Update to Unicode version 7.0

Summary: Update Unicode data to version 7.0

Reviewers: rwbarton, austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoghc-prim: Use population count appropriate for platform
Ben Gamari [Tue, 21 Oct 2014 20:00:02 +0000 (15:00 -0500)] 
ghc-prim: Use population count appropriate for platform

This #ifdef was previously x86-centric and consequently the 64-bit
implementation was chosen for ARM.

Reviewers: rwbarton, hvr, austin, tibbe

Reviewed By: hvr, austin, tibbe

Subscribers: hvr, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoUse objdump instead of nm to derive constants on OpenBSD
Austin Seipp [Tue, 21 Oct 2014 19:58:21 +0000 (14:58 -0500)] 
Use objdump instead of nm to derive constants on OpenBSD

Summary: OpenBSD's nm doesn't support the -P option and there appears to be no other way to get the desired information from it.

Reviewers: kgardas, #ghc, austin

Reviewed By: kgardas, #ghc, austin

Subscribers: austin, ggreif

Projects: #ghc

Differential Revision:

GHC Trac Issues: #9549

5 years agoUpdated testsuite/.gitignore to cover artifacts on Windows.
Gintautas Miliauskas [Tue, 21 Oct 2014 19:57:57 +0000 (14:57 -0500)] 
Updated testsuite/.gitignore to cover artifacts on Windows.

Test Plan: git status after a test run

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9679

5 years agoMake Applicative-Monad fixes for tests.
Geoffrey Mainland [Thu, 2 Oct 2014 21:39:34 +0000 (17:39 -0400)] 
Make Applicative-Monad fixes for tests.

5 years agoUpdate primitive, vector, and dph submodules.
Geoffrey Mainland [Thu, 28 Aug 2014 02:33:44 +0000 (22:33 -0400)] 
Update primitive, vector, and dph submodules.

5 years agoReify data family instances correctly.
Richard Eisenberg [Mon, 20 Oct 2014 19:36:57 +0000 (15:36 -0400)] 
Reify data family instances correctly.

Fix #9692.

The reifier didn't account for the possibility that data/newtype
instances are sometimes eta-reduced. It now eta-expands as necessary.

Test Plan: th/T9692

Reviewers: simonpj, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoClarify location of Note. Comment change only.
Richard Eisenberg [Mon, 20 Oct 2014 19:36:37 +0000 (15:36 -0400)] 
Clarify location of Note. Comment change only.

5 years agoTest #9692 in th/T9692
Richard Eisenberg [Mon, 20 Oct 2014 19:11:59 +0000 (15:11 -0400)] 
Test #9692 in th/T9692

5 years agoRevert "rts/PrimOps.cmm: follow '_static_closure' update"
Sergei Trofimovich [Tue, 21 Oct 2014 08:40:07 +0000 (09:40 +0100)] 
Revert "rts/PrimOps.cmm: follow '_static_closure' update"

This reverts commit eb191ab6c85f4b668a6e9151dcecaf1f1e7ec7c2.

Follows revert of STATIC_CLOSURE and restores UNREG build.

5 years agoUpdate Haddock submodule
Austin Seipp [Tue, 21 Oct 2014 01:08:14 +0000 (20:08 -0500)] 
Update Haddock submodule

As requested by Yuras Shumovich, this updates Haddock to include
.arcconfig and .arclint files, so diffs for GHC patches can go into

Signed-off-by: Austin Seipp <>
5 years agoRevert "Place static closures in their own section."
Edward Z. Yang [Mon, 20 Oct 2014 23:03:50 +0000 (16:03 -0700)] 
Revert "Place static closures in their own section."

This reverts commit b23ba2a7d612c6b466521399b33fe9aacf5c4f75.


5 years agoRevert "BC-breaking changes to C-- CLOSURE syntax."
Edward Z. Yang [Mon, 20 Oct 2014 23:01:45 +0000 (16:01 -0700)] 
Revert "BC-breaking changes to C-- CLOSURE syntax."

This reverts commit 3b5a840bba375c4c4c11ccfeb283f84c3a1ef22c.

5 years agoRevert "Properly generate info tables for static closures in C--."
Edward Z. Yang [Mon, 20 Oct 2014 23:01:39 +0000 (16:01 -0700)] 
Revert "Properly generate info tables for static closures in C--."

This reverts commit 178eb9060f369b216f3f401196e28eab4af5624d.

5 years agoRevert "Rename _closure to _static_closure, apply naming consistently."
Edward Z. Yang [Mon, 20 Oct 2014 22:57:13 +0000 (15:57 -0700)] 
Revert "Rename _closure to _static_closure, apply naming consistently."

This reverts commit 35672072b4091d6f0031417bc160c568f22d0469.


5 years agoRevert "Check for staticclosures section in Windows linker."
Edward Z. Yang [Mon, 20 Oct 2014 22:55:29 +0000 (15:55 -0700)] 
Revert "Check for staticclosures section in Windows linker."

This reverts commit 2fc0c6cf594731f343b4f8a5b3ecf9e72db4c3c0.

5 years agoRevert "Fix typo in section name: no leading period."
Edward Z. Yang [Mon, 20 Oct 2014 22:55:12 +0000 (15:55 -0700)] 
Revert "Fix typo in section name: no leading period."

This reverts commit e8dac6dc60beea863c3a5daded68f5157ab546fb.

5 years agoSync up `containers` submodule to latest `master`-tip
Herbert Valerio Riedel [Mon, 20 Oct 2014 09:38:27 +0000 (11:38 +0200)] 
Sync up `containers` submodule to latest `master`-tip

This updates `containers` to provide more specialised `Foldable`
instance methods, see also

for more details.

5 years agoIndentation and non-semantic changes only.
Edward Z. Yang [Thu, 16 Oct 2014 05:51:59 +0000 (22:51 -0700)] 
Indentation and non-semantic changes only.

Get these lines fitting in 80 columns, and replace ptext (sLit ...) with text

Signed-off-by: Edward Z. Yang <>
Test Plan: validate

Reviewers: simonmar, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoRefactor module imports in base
Herbert Valerio Riedel [Sun, 19 Oct 2014 12:15:14 +0000 (14:15 +0200)] 
Refactor module imports in base

This commit removes a couple of

  {-# OPTIONS_GHC -fno-warn-unused-imports #-}

by cleaning up the imports, as well as ensuring that all modules in the
GHC.* hierarchy avoid importing the `Prelude` module to clean-up the
import graph a bit.

5 years agoPython 3 support, second attempt (Trac #9184)
Krzysztof Gogolewski [Sun, 19 Oct 2014 11:41:24 +0000 (13:41 +0200)] 
Python 3 support, second attempt (Trac #9184)

This is a fixup of

The only difference is in findTFiles (first commit), which
previously broke Windows runner; now I translated literally
instead attempting to improve it, and checked it works.

Test Plan:
I used validate under 2,3 on Linux and under 2 on msys2.
On Windows I've seen a large number of failures, but they don't
seem to be connected with the patch.

Reviewers: hvr, simonmar, thomie, austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9184

5 years agoRemove redundant explicit `Prelude` imports
Herbert Valerio Riedel [Sun, 19 Oct 2014 10:03:11 +0000 (12:03 +0200)] 
Remove redundant explicit `Prelude` imports

Since they're implied by the lack of `NoImplicitPrelude`

5 years agoGeneralise `Control.Monad.{foldM,foldM_}` to `Foldable` (#9586)
Herbert Valerio Riedel [Sat, 18 Oct 2014 15:01:11 +0000 (17:01 +0200)] 
Generalise `Control.Monad.{foldM,foldM_}` to `Foldable` (#9586)

With this change `Control.Monad.foldM` becomes an alias for

Reviewed By: austin, ekmett

Differential Revision:

5 years agoRemove obsolete Data.OldTypeable (#9639)
Michael Karg [Sat, 18 Oct 2014 13:50:48 +0000 (15:50 +0200)] 
Remove obsolete Data.OldTypeable (#9639)

This finally removes the `Data.OldTypeable` module (which
has been deprecated in 7.8), from `base`, compiler and testsuite.

The deprecated `Typeable{1..7}` aliases in `Data.Typeable` are not
removed yet in order to give existing code a bit more time to adapt.

Reviewed By: hvr, dreixel

Differential Revision:

5 years agoImplement optimized NCG `MO_Ctz W64` op for i386 (#9340)
Herbert Valerio Riedel [Sat, 18 Oct 2014 12:32:33 +0000 (14:32 +0200)] 
Implement optimized NCG `MO_Ctz W64` op for i386 (#9340)

This is an optimization to the CTZ primops introduced for #9340

Previously we called out to `hs_ctz64`, but we can actually generate
better hand-tuned code while avoiding the FFI ccall.

With this patch, the code

  {-# LANGUAGE MagicHash #-}
  module TestClz0 where
  import GHC.Prim
  ctz64 :: Word64# -> Word#
  ctz64 x = ctz64# x

results in the following assembler generated by NCG on i386:

      movl (%ebp),%eax
      movl 4(%ebp),%ecx
      movl %ecx,%edx
      orl %eax,%edx
      movl $64,%edx
      je _nAO

      bsf %ecx,%ecx
      addl $32,%ecx
      bsf %eax,%eax
      cmovne %eax,%ecx
      movl %ecx,%edx
      movl %edx,%esi
      addl $8,%ebp
      jmp *(%ebp)

For comparision, here's what LLVM 3.4 currently generates:

  000000fc <TestClzz_ctzz64_info>:
    fc:   0f bc 45 04             bsf    0x4(%ebp),%eax
   100:   b9 20 00 00 00          mov    $0x20,%ecx
   105:   0f 45 c8                cmovne %eax,%ecx
   108:   83 c1 20                add    $0x20,%ecx
   10b:   8b 45 00                mov    0x0(%ebp),%eax
   10e:   8b 55 08                mov    0x8(%ebp),%edx
   111:   0f bc f0                bsf    %eax,%esi
   114:   85 c0                   test   %eax,%eax
   116:   0f 44 f1                cmove  %ecx,%esi
   119:   83 c5 08                add    $0x8,%ebp
   11c:   ff e2                   jmp    *%edx

Reviewed By: austin

Auditors: simonmar

Differential Revision:

5 years agorts: fix unused parameter warning
Austin Seipp [Fri, 17 Oct 2014 16:58:07 +0000 (11:58 -0500)] 
rts: fix unused parameter warning

If `pthread_setname_np` is not available, then a regular
./validate will fail due to warnings; the `name` parameter to
`createOSThread` becomes unused.

Signed-off-by: Austin Seipp <>
Test Plan: iiam

Reviewers: simonmar, nomeata, jstolarek, hvr

Reviewed By: nomeata, jstolarek, hvr

Subscribers: nomeata, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoUpdate T6056 output
Joachim Breitner [Fri, 17 Oct 2014 14:54:22 +0000 (16:54 +0200)] 
Update T6056 output

according to travis (and proably Harbormaster), although I just cannot
reproduce it here.

5 years agoAvoid printing uniques in specialization rules
Joachim Breitner [Fri, 17 Oct 2014 09:09:16 +0000 (11:09 +0200)] 
Avoid printing uniques in specialization rules

Akio found an avoidable cause of non-determinisim: The names of RULES
generated by Specialise had uniques in them:
    "SPEC $cshowsPrec_a2QX @ [GHC.Types.Char]" [ALWAYS] forall ...
By using showSDocForUser instead of showSDocDump when building the rule
name, this is avoided:
    "SPEC $cshowsPrec @ [Char]" [ALWAYS] forall ...
See #4012, comments 61ff.

5 years agoDeclare official GitHub home of libraries/deepseq
Herbert Valerio Riedel [Thu, 16 Oct 2014 07:47:31 +0000 (09:47 +0200)] 
Declare official GitHub home of libraries/deepseq

Effective immediately, `deepseq` is maintained officially by the
core-library-comittee.  Moreover, pushing to libraries/deepseq requires
pushing to ssh:// from now on.

[skip ci]

5 years agoMake tails a good producer (#9670)
David Feuer [Thu, 16 Oct 2014 07:44:25 +0000 (09:44 +0200)] 
Make tails a good producer (#9670)

Reviewed By: nomeata, austin
Differential Revision:

5 years agoMake Data.List.Inits fast
David Feuer [Thu, 16 Oct 2014 07:42:27 +0000 (09:42 +0200)] 
Make Data.List.Inits fast

Fixes #9345. Use a modified banker's queue to achieve amortized optimal
performance for inits. The previous implementation was extremely slow.

Reviewed By: nomeata, ekmett, austin

Differential Revision:

5 years agoAdd a configure test for pthread_setname_np
Simon Marlow [Mon, 13 Oct 2014 17:30:30 +0000 (18:30 +0100)] 
Add a configure test for pthread_setname_np

5 years agoFix comment typos: lll -> ll, THe -> The
Jan Stolarek [Tue, 14 Oct 2014 12:38:16 +0000 (14:38 +0200)] 
Fix comment typos: lll -> ll, THe -> The

5 years agoActually put in new perf number for T4801
Joachim Breitner [Mon, 13 Oct 2014 21:33:45 +0000 (23:33 +0200)] 
Actually put in new perf number for T4801

which I just put it in comments. Thanks Yuras for noticing, and sorry
for the noise.

5 years agoT9675: Allow Much wider range of values
Joachim Breitner [Mon, 13 Oct 2014 17:20:44 +0000 (19:20 +0200)] 
T9675: Allow Much wider range of values

to include at least what’s observed on ghc-speed and my laptop, and
hopefully also Harbormaster.

5 years agoUpdate more performance numbers due to stricter seqDmdType
Joachim Breitner [Mon, 13 Oct 2014 14:37:15 +0000 (16:37 +0200)] 
Update more performance numbers due to stricter seqDmdType

including T9675 itself. Maybe its memory behaviour is too spiky for
max_bytes_used and peak_megabytes_allocated to be used sensibly at all.

5 years agoseqDmdType needs to seq the DmdEnv as well
Joachim Breitner [Mon, 13 Oct 2014 10:44:56 +0000 (12:44 +0200)] 
seqDmdType needs to seq the DmdEnv as well

otherwise this can retain large lazy calculations. This fixed one space
leak pointed out in #9675.

5 years agoAdjust T9675 baseline numbers based on ghc-speed
Joachim Breitner [Mon, 13 Oct 2014 11:49:55 +0000 (13:49 +0200)] 
Adjust T9675 baseline numbers based on ghc-speed

although I obtained them originally from a clean validate tree on my
laptop, they did not match what I found on the build bot host.

5 years agoCompiler performance benchmark for #9675
Joachim Breitner [Mon, 13 Oct 2014 09:27:17 +0000 (11:27 +0200)] 
Compiler performance benchmark for #9675

so that whoever improves the situation can feel good about it.

5 years agoUpdate `time` submodule to address linker issue
Herbert Valerio Riedel [Mon, 13 Oct 2014 07:56:28 +0000 (09:56 +0200)] 
Update `time` submodule to address linker issue

See also

However, while the `time-1.5` package now loads successful in GHCi,
the linker warnings as reported in #9297 occur (which let the
testsuite fail for a dozen of testcases due to this additional

5 years agoFix build on some platforms
Simon Marlow [Sun, 12 Oct 2014 16:39:23 +0000 (17:39 +0100)] 
Fix build on some platforms

5 years agoRefactor to avoid need for `Unicode.hs-boot`
Herbert Valerio Riedel [Sat, 11 Oct 2014 10:35:28 +0000 (12:35 +0200)] 
Refactor to avoid need for `Unicode.hs-boot`

This avoids the import-cycle caused by the import of `Foreign.C.Types`
by using `Int` instead of `CInt` for the Unicode classification
functions. This refactoring also allows to remove a couple of

Reviewed By: rwbarton, ekmett

Differential Revision:

5 years agoExtend windows detection in testsuite to recognize MSYS target
Gintautas Miliauskas [Wed, 17 Sep 2014 18:57:39 +0000 (20:57 +0200)] 
Extend windows detection in testsuite to recognize MSYS target

Currently, the detection recognizes the following `uname -s` strings:

 - `CYGWIN_NT-6.3`
 - `MINGW32_NT-6.3`
 - `MINGW64_NT_6.3`

However, MSYS2 provides an additional target, in which case `uname -s`
returns a string such as `MSYS_NT-6.3`. In all these cases, the system
ought to be recognized as being a `windows` os by the testsuite runner.

See also #9604

5 years agoFallback to `ctypes.cdll` if `ctypes.windll` unavailable
Gintautas Miliauskas [Wed, 17 Sep 2014 18:57:04 +0000 (20:57 +0200)] 
Fallback to `ctypes.cdll` if `ctypes.windll` unavailable

On Windows, we may be using a native build of Python or a mingw/msys build. The
former exports `ctypes.windll`, the latter exports `cdll`. Previously the code
threw an exception when using the msys Python because it expected `windll` to
always be available on Windows.

Differential Revision:

5 years agoRemove a few redundant `.hs-boot` files
Herbert Valerio Riedel [Fri, 10 Oct 2014 22:44:54 +0000 (00:44 +0200)] 
Remove a few redundant `.hs-boot` files

There don't seem to be any corresponding `{-# SOURCE #-}` for the removed
`.hs-boot`-files anymore (if there ever was any in the first place).

This also removes a commented out `{-# SOURCE #-}` import which turns up when
grepping the source for `{-# SOURCE #-}` occurences.

5 years agorts: don't crash on 'hs_init(NULL, NULL)' in debug rts
Sergei Trofimovich [Fri, 10 Oct 2014 20:43:30 +0000 (21:43 +0100)] 
rts: don't crash on 'hs_init(NULL, NULL)' in debug rts

Caught by T6006 as a NULL dereference:

  Command: ./T6006

  Invalid read of size 8
     at 0x660ED9: hs_init_ghc (RtsStartup.c:168)
     by 0x660D90: hs_init (RtsStartup.c:112)
     by 0x40504D: main (in /home/slyfox/dev/git/ghc-validate/testsuite/tests/rts/T6006)
   Address 0x0 is not stack'd, malloc'd or (recently) free'd

The regression was introduced by commit

Signed-off-by: Sergei Trofimovich <>
5 years agoName worker threads using pthread_setname_np
Simon Marlow [Fri, 10 Oct 2014 13:26:19 +0000 (14:26 +0100)] 
Name worker threads using pthread_setname_np

This helps identify threads in gdb particularly in processes with a
lot of threads.

5 years agoRewrite section 1 of the Backpack manual. [skip ci]
Edward Z. Yang [Fri, 10 Oct 2014 07:01:57 +0000 (00:01 -0700)] 
Rewrite section 1 of the Backpack manual. [skip ci]

Signed-off-by: Edward Z. Yang <>
5 years agoUpdate haddock submodule with lazy IO fix.
Edward Z. Yang [Fri, 10 Oct 2014 04:40:41 +0000 (21:40 -0700)] 
Update haddock submodule with lazy IO fix.

Signed-off-by: Edward Z. Yang <>
5 years agoIgnore exe files in base (from tests)
Edward Z. Yang [Fri, 3 Oct 2014 22:15:52 +0000 (15:15 -0700)] 
Ignore exe files in base (from tests)

Signed-off-by: Edward Z. Yang <>
5 years agoMake the linker more robust to errors
Simon Marlow [Wed, 1 Oct 2014 12:15:05 +0000 (13:15 +0100)] 
Make the linker more robust to errors

When linking fails because there was a problem with the supplied
object file, then we should not barf() or exit, we should emit a
suitable error message and return an error code to the caller.  We
should also free all memory that might have been allocated during
linking, and generally not do any damage.  This patch fixes most
common instances of this problem.

Test Plan: validate

Reviewers: rwbarton, austin, ezyang

Reviewed By: ezyang

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision: