4 years agoFix panic on [t| _ |] (Trac #9879)
Thomas Winant [Mon, 15 Dec 2014 15:47:07 +0000 (09:47 -0600)] 
Fix panic on [t| _ |] (Trac #9879)

Type brackets containing a wildcard, e.g. `[t| _ |]`, caused a panic.
Fix it by disallowing wildcards in type brackets.

Together with D572, this fixes #9879.

Test Plan: new test WildcardInTypeBrackets should pass

Reviewers: austin

Reviewed By: austin

Subscribers: carter, thomie, monoidal

Differential Revision:

GHC Trac Issues: #9879

4 years agoWrite release notes for -XStaticPointers.
Facundo Domínguez [Mon, 15 Dec 2014 15:44:27 +0000 (09:44 -0600)] 
Write release notes for -XStaticPointers.

Test Plan: ./validate

Reviewers: goldfire, austin

Reviewed By: austin

Subscribers: mboes, carter, thomie

Differential Revision:

GHC Trac Issues: #7015

4 years agoChanging prefetch primops to have a `seq`-like interface
Carter Tazio Schonwald [Mon, 15 Dec 2014 15:42:36 +0000 (09:42 -0600)] 
Changing prefetch primops to have a `seq`-like interface

The current primops for prefetching do not properly work in pure code;
namely, the primops are not 'hoisted' into the correct call sites based
on when arguments are evaluated. Instead, they should use a `seq`-like
interface, which will cause it to be evaluated when the needed term is.

See #9353 for the full discussion.

Test Plan: updated tests for pure prefetch in T8256 to reflect the design changes in #9353

Reviewers: simonmar, hvr, ekmett, austin

Reviewed By: ekmett, austin

Subscribers: merijn, thomie, carter, simonmar

Differential Revision:

GHC Trac Issues: #9353

4 years agostm: update submodule for #9169 addition
Austin Seipp [Mon, 15 Dec 2014 15:34:05 +0000 (09:34 -0600)] 
stm: update submodule for #9169 addition

Signed-off-by: Austin Seipp <>
4 years agoMake Core Lint check for locally-bound GlobalIds
Simon Peyton Jones [Sat, 13 Dec 2014 22:53:54 +0000 (22:53 +0000)] 
Make Core Lint check for locally-bound GlobalIds

There should be no bindings in this module for a GlobalId;
except after CoreTidy, when top-level bindings are globalised.

To check for this, I had to make the CoreToDo pass part of the
environment that Core Lint caries.  But CoreToDo is defined in
CoreMonad, which (before this patch) called CoreLint.

So I had to do quite a bit of refactoring, moving some
lint-invoking code into CoreLint itself.  Crucially, I also
more tcLookupImported_maybe, importDecl, and checkwiredInTyCon
from TcIface (which use CoreLint) to LoadIface (which doesn't).
This is probably better structure anyway.

So most of this patch is refactoring. The actual check for
GlobalIds is in CoreLint.lintAndScopeId

4 years agoPattern-synonym matcher and builder Ids must be *LocalIds*
Simon Peyton Jones [Sat, 13 Dec 2014 22:47:01 +0000 (22:47 +0000)] 
Pattern-synonym matcher and builder Ids must be *LocalIds*

This easy-to-make mistake meant that pattern-synonym matcher and
builder Ids weren't being treated as locally defined by the simpplier.
That meant that we never looked up them up in the environment, got an
out-of-date unfolding, which made the Simplifier fall into an infinite
loop.  This was the cause of Trac #98587, but it was quite tricky to

In a separate patch I'll make Lint check for locally-bound GlobalIds,
since they are always an error.

4 years agoUpdate `bytestring` submodule to RC
Herbert Valerio Riedel [Sun, 14 Dec 2014 19:36:33 +0000 (20:36 +0100)] 
Update `bytestring` submodule to RC

NB: this still carries the wrong version number but will
be released as

4 years agoFixup bad haddock.base perf-num bump in 0c9c2d89
Herbert Valerio Riedel [Sun, 14 Dec 2014 19:35:12 +0000 (20:35 +0100)] 
Fixup bad haddock.base perf-num bump in 0c9c2d89

4 years agoUpdate `binary` submodule to final release
Herbert Valerio Riedel [Sun, 14 Dec 2014 17:59:00 +0000 (18:59 +0100)] 
Update `binary` submodule to final release

This also introduces a "bootstrap" `cabal_macros.h` header to provide
the `MIN_VERSION_base()` macro during Cabal bootstrapping which as it is
now used by `binary`.

4 years agoUpdate `filepath` submodule to current RC
Herbert Valerio Riedel [Sun, 14 Dec 2014 13:01:13 +0000 (14:01 +0100)] 
Update `filepath` submodule to current RC

4 years agoUpdate `time` submodule to final release
Herbert Valerio Riedel [Sun, 14 Dec 2014 09:58:26 +0000 (10:58 +0100)] 
Update `time` submodule to final release

4 years agoRe-Update Haddock submodule to latest `master` tip
Herbert Valerio Riedel [Sun, 14 Dec 2014 09:33:43 +0000 (10:33 +0100)] 
Re-Update Haddock submodule to latest `master` tip

The previous attempt failed, but hopefully this one succeeds...

This also updates the perf-numbers for `haddock.base` and `haddock.Cabal`

NB: this switches from `ghc-head` to `master` branch temporarily
    until GHC 7.10 has been properly branched off.

4 years agopowerpc: fix and enable shared libraries by default on linux
Sergei Trofimovich [Sun, 14 Dec 2014 14:30:12 +0000 (14:30 +0000)] 
powerpc: fix and enable shared libraries by default on linux

And fix things all the way down to it. Namely:
    - remove 'r30' from free registers, it's an .LCTOC1 register
      for gcc. generated .plt stubs expect it to be initialised.
    - fix PicBase computation, which originally forgot to use 'tmp'
      reg in 'initializePicBase_ppc.fetchPC'
    - mark 'ForeighTarget's as implicitly using 'PicBase' register
      (see comment for details)
    - add 64-bit MO_Sub and test on alloclimit3/4 regtests
    - fix dynamic label offsets to match with .LCTOC1 offset

Signed-off-by: Sergei Trofimovich <>
Test Plan: validate passes equal amount of vanilla/dyn tests

Reviewers: simonmar, erikd, austin

Reviewed By: erikd, austin

Subscribers: carter, thomie

Differential Revision:

GHC Trac Issues: #8024, #9831

4 years agoRevert "Update Haddock submodule to latest `master` tip"
Herbert Valerio Riedel [Sun, 14 Dec 2014 12:43:23 +0000 (13:43 +0100)] 
Revert "Update Haddock submodule to latest `master` tip"

This reverts commit 7f634320a2c39f4f81f631deb844acbaebaced66 again for now as
it causes validate's bindist phase to fail with

  haddock: internal error: .../install   dir/lib/ghc-7.9.20141214/html:
     getDirectoryContents: does not exist (No such file or directory)

4 years agoUpdate Haddock submodule to latest `master` tip
Herbert Valerio Riedel [Sun, 14 Dec 2014 09:33:43 +0000 (10:33 +0100)] 
Update Haddock submodule to latest `master` tip

This also updates the perf-numbers for `haddock.base` and `haddock.Cabal`

NB: this switches from `ghc-head` to `master` branch temporarily
    until GHC 7.10 has been properly branched off.

4 years agoOnly use -fasm on platforms with an NCG (Closes: #9884).
Erik de Castro Lopo [Sun, 14 Dec 2014 08:04:28 +0000 (08:04 +0000)] 
Only use -fasm on platforms with an NCG (Closes: #9884).

Summary: Signed-off-by: Erik de Castro Lopo <>

Reviewers: austin, carter

Reviewed By: carter

Subscribers: carter, thomie

Differential Revision:

GHC Trac Issues: #9884

4 years agoParser: remove unused rule (copy/paste error)
Sergei Trofimovich [Sat, 13 Dec 2014 21:05:42 +0000 (21:05 +0000)] 
Parser: remove unused rule (copy/paste error)

Found out when tracking down conflicts reported by happy.
It was accidentally introduced in large Api Annotations
patch: 803fc5db31f084b73713342cdceaed5a9c664267

  unused rules: 1
  shift/reduce conflicts:  60
  reduce/reduce conflicts: 16
  shift/reduce conflicts:  60
  reduce/reduce conflicts: 12

Unused rule is seen in happy's --info= output as:
    rule 180 is unused
    decl_cls -> 'default' infixexp '::' sigtypedoc     (180)
    decl_cls -> 'default' infixexp '::' sigtypedoc     (181)

While at it removed 'q' typo in parser conflict log :)

Signed-off-by: Sergei Trofimovich <>
Reviewers: simonmar, austin, alanz

Reviewed By: alanz

Subscribers: carter, thomie

Differential Revision:

4 years agoreduceTyFamApp_maybe should *not* normalise arguments first.
Richard Eisenberg [Sat, 13 Dec 2014 14:54:53 +0000 (09:54 -0500)] 
reduceTyFamApp_maybe should *not* normalise arguments first.

Doing so made the solver gobble up tons of memory, now that matchFam
calls reduceTyFamApp_maybe. But, I don't know why, yet! Will
look more closely at this soon.

4 years agoFlat constraint --> Simple constraint
Richard Eisenberg [Wed, 10 Dec 2014 21:58:09 +0000 (16:58 -0500)] 
Flat constraint --> Simple constraint

4 years agoRewrite `Coercible` solver
Richard Eisenberg [Fri, 12 Dec 2014 22:19:21 +0000 (17:19 -0500)] 
Rewrite `Coercible` solver

This is a rewrite of the algorithm to solve for Coercible "instances".

A preliminary form of these ideas is at

The basic idea here is that the `EqPred` constructor of `PredTree`
now is parameterised by a new type `EqRel` (where
`data EqRel = NomEq | ReprEq`). Thus, every equality constraint can
now talk about nominal equality (the usual case) or representational
equality (the `Coercible` case).

This is a change from the previous
behavior where `Coercible` was just considered a regular class with
a special case in `matchClassInst`.

Because of this change, representational equalities are now
canonicalized just like nominal ones, allowing more equalities
to be solved -- in particular, the case at the top of #9117.

A knock-on effect is that the flattener must be aware of the
choice of equality relation, because the inert set now stores
both representational inert equalities alongside the nominal
inert equalities. Of course, we can use representational equalities
to rewrite only within another representational equality --
thus the parameterization of the flattener.

A nice side effect of this change is that I've introduced a new
type `CtFlavour`, which tracks G vs. W vs. D, removing some ugliness
in the flattener.

This commit includes some refactoring as discussed on D546.
It also removes the ability of Deriveds to rewrite Deriveds.

This fixes bugs #9117 and #8984.

Reviewers: simonpj, austin, nomeata

Subscribers: carter, thomie

Differential Revision:

GHC Trac Issues: #9117, #8984

4 years ago32-bit performance changes following constraint solver improvements
Simon Peyton Jones [Thu, 11 Dec 2014 20:32:02 +0000 (20:32 +0000)] 
32-bit performance changes following constraint solver improvements

Things get faster, except T5030

4 years agoFix an obscure but terrible bug in the simplifier (Trac #9567)
Simon Peyton Jones [Thu, 11 Dec 2014 17:12:49 +0000 (17:12 +0000)] 
Fix an obscure but terrible bug in the simplifier (Trac #9567)

The issue was that contInputType simply gave the wrong answer
for type applications.

There was no way to fix contInputType; it just didn't have enough
information.  So I did this:

* Split the ApplyTo constructor of SimplUtils.SimplCont into
  I used record syntax for them; we should do this for some
  of the other constructors too.

* The latter carries a sc_hole_ty, which is the type of the
  continuation's "hole"

* Maintaining this type meant that I had do to something
  similar for SimplUtils.ArgSpec.

* I renamed contInputType to contHoleType for consistency.

* I did a bit of refactoring around the call to tryRules
  in Simplify, which was jolly confusing before.

The resulting code is quite nice now.  And it has the additional
merit that it works.

The tests are simply tc124 and T7891 with -O enabled.

4 years agoTest Trac #9090
Simon Peyton Jones [Thu, 11 Dec 2014 10:44:32 +0000 (10:44 +0000)] 
Test Trac #9090

4 years agoAdd a third test variant to Trac #9872
Simon Peyton Jones [Thu, 11 Dec 2014 10:11:41 +0000 (10:11 +0000)] 
Add a third test variant to Trac #9872

4 years agoWhite space wibble only
Simon Peyton Jones [Thu, 11 Dec 2014 08:39:10 +0000 (08:39 +0000)] 
White space wibble only

4 years agoComments only: move flattening notes to TcFlatten
Simon Peyton Jones [Wed, 10 Dec 2014 14:56:30 +0000 (14:56 +0000)] 
Comments only: move flattening notes to TcFlatten

4 years agoTests for Trac #9872
Simon Peyton Jones [Wed, 10 Dec 2014 14:36:47 +0000 (14:36 +0000)] 
Tests for Trac #9872

4 years agoTestsuite wibbles from constraint-solver improvements
Simon Peyton Jones [Wed, 10 Dec 2014 14:35:54 +0000 (14:35 +0000)] 
Testsuite wibbles from constraint-solver improvements

4 years agoImplement a fast path for new constraints looking like (a~b), namely unifyWanted
Simon Peyton Jones [Wed, 10 Dec 2014 14:11:51 +0000 (14:11 +0000)] 
Implement a fast path for new constraints looking like (a~b), namely unifyWanted

Looking at some typechecker traces I could see places where we were laboriously
creating a Refl coercion.  This patch short-circuits the process.

See TcCanonical:
  Note [unifyWanted and unifyDerived]
  Note [Decomposing TyConApps]

I ended up with some refactoring, notably

  * I moved xCtEvidence, rewriteEvidence, rewriteEqEvidence
    from TcSMonad to TcCanonical

There are some knock-on effects, but only minor ones.

4 years agoWhen flattening, try reducing type-family applications eagerly
Simon Peyton Jones [Wed, 10 Dec 2014 13:54:17 +0000 (13:54 +0000)] 
When flattening, try reducing type-family applications eagerly

This short-cut can improve performance quite a bit, by short-circuiting
the process of creating a fresh constraint and binding for each reduction.

See Note [Reduce type family applications eagerly] in TcFlatten

To do this I had to generalise the inert_flat_cache a bit, so that the
rhs is not necessarily a type variable; but nothing fundamental.

4 years agoFix type-variable details naming (fixes misleading debug output)
Simon Peyton Jones [Wed, 10 Dec 2014 13:12:47 +0000 (13:12 +0000)] 
Fix type-variable details naming (fixes misleading debug output)

4 years agoGet rid of TcMType.newWantedEvVar(s)
Simon Peyton Jones [Wed, 10 Dec 2014 13:12:11 +0000 (13:12 +0000)] 
Get rid of TcMType.newWantedEvVar(s)

Hardly used, not helpful.  Use newEvVar instead.

4 years agoReorganise the work list, so that flattening goals are treated in the right order
Simon Peyton Jones [Tue, 9 Dec 2014 17:38:12 +0000 (17:38 +0000)] 
Reorganise the work list, so that flattening goals are treated in the right order

Trac #9872 showed the importance of processing goals in depth-first, so that
we do not build up a huge pool of suspended function calls, waiting for their
children to fire.  There is a detailed explanation in
     Note [The flattening work list]
in TcFlatten

The effect for Trac #9872 (slow1.hs) is dramatic.  We go from too long
to wait down to 28Gbyte allocation.  GHC 7.8.3 did 116Gbyte allocation!

4 years agoAdd Ord instances to TH
Richard Eisenberg [Tue, 9 Dec 2014 22:39:11 +0000 (17:39 -0500)] 
Add Ord instances to TH

4 years agocompiler: fix trac issue #9817
Marios Titas [Wed, 10 Dec 2014 10:17:22 +0000 (04:17 -0600)] 
compiler: fix trac issue #9817

When we call runHandlers, we must pass it a ForeignPtr. To ensure that
this happens, we introduce a wrapper that receives a plain Ptr and
converts it into a ForeignPtr. Then we adjust startSignalHandlers in
rts/posix/Signals.c to call the wrapper instead of calling runHandlers

Reviewers: hvr, austin, rwbarton, simonmar

Reviewed By: austin, simonmar

Subscribers: simonmar, thomie, carter

Differential Revision:

GHC Trac Issues: #9817

4 years agoOnly run subsections_via_symbols test when LLVM is available.
Edward Z. Yang [Wed, 10 Dec 2014 08:08:31 +0000 (00:08 -0800)] 
Only run subsections_via_symbols test when LLVM is available.

Summary: Signed-off-by: Edward Z. Yang <>

Test Plan: validate

Reviewers: austin

Subscribers: carter, thomie

Differential Revision:

4 years agoAdd proper expected output for T5435_dyn_asm on Darwin
Edward Z. Yang [Wed, 10 Dec 2014 07:58:04 +0000 (23:58 -0800)] 
Add proper expected output for T5435_dyn_asm on Darwin

Summary: Signed-off-by: Edward Z. Yang <>

Test Plan: validate

Reviewers: austin

Subscribers: carter, thomie

Differential Revision:

4 years agoLink pre-ARMv6 spinlocks into all RTS variants
Joachim Breitner [Wed, 10 Dec 2014 00:18:11 +0000 (18:18 -0600)] 
Link pre-ARMv6 spinlocks into all RTS variants

For compatibility with ARM machines from pre v6, the RTS provides
implementations of certain atomic operations. Previously, these
were only included in the threaded RTS.

But ghc (the library) contains the code in compiler/cbits/genSym.c, which
uses these operations if there is more than one capability. But there is only
one libHSghc, so the linker wants to resolve these symbols in every case.

By providing these operations in all RTSs, the linker is happy. The only
downside is a small amount of dead code in the non-threaded RTS on old ARM

Test Plan: It helped here.

Reviewers: bgamari, austin

Reviewed By: bgamari, austin

Subscribers: carter, thomie

Differential Revision:

GHC Trac Issues: #8951

4 years agoDocument splitAt deviation from the Report
David Feuer [Wed, 10 Dec 2014 00:12:33 +0000 (18:12 -0600)] 
Document splitAt deviation from the Report

`splitAt` is stricter than the Report specifies, so we should
say so.

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: carter, thomie

Projects: #ghc

Differential Revision:

GHC Trac Issues: #9870

4 years agofix misleading error message regarding function arity
Yuras Shumovich [Wed, 10 Dec 2014 00:11:44 +0000 (18:11 -0600)] 
fix misleading error message regarding function arity

The error reports something like:

  The function ‘f’ is applied to three arguments,
  but its type ‘Int -> Float -> Char -> Bool’ has only three

The original type was "Monad m => Int -> Float -> m Bool", but
"m" was unified with "-> Char".

Now it looks better:

  The function ‘f’ is applied to three arguments,
  its type is ‘Int -> Float -> m0 Bool’,
  it is specialized to ‘Int -> Float -> Char -> Bool’

Test Plan: T9605

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: carter, thomie

Differential Revision:

GHC Trac Issues: #9605

4 years agoImplement -XStaticValues
Facundo Domínguez [Wed, 10 Dec 2014 00:10:18 +0000 (18:10 -0600)] 
Implement -XStaticValues

As proposed in [1], this extension introduces a new syntactic form
`static e`, where `e :: a` can be any closed expression. The static form
produces a value of type `StaticPtr a`, which works as a reference that
programs can "dereference" to get the value of `e` back. References are
like `Ptr`s, except that they are stable across invocations of a

The relevant wiki pages are [2, 3], which describe the motivation/ideas
and implementation plan respectively.

[1] Jeff Epstein, Andrew P. Black, and Simon Peyton-Jones. Towards
Haskell in the cloud. SIGPLAN Not., 46(12):118–129, September 2011. ISSN

Authored-by: Facundo Domínguez <>
Authored-by: Mathieu Boespflug <>
Authored-by: Alexander Vershilov <>
Test Plan: `./validate`

Reviewers: hvr, simonmar, simonpj, austin

Reviewed By: simonpj, austin

Subscribers: qnikst, bgamari, mboes, carter, thomie, goldfire

Differential Revision:

GHC Trac Issues: #7015

4 years agoProposal for Backpack file format [skip ci]
Edward Z. Yang [Wed, 10 Dec 2014 01:11:57 +0000 (17:11 -0800)] 
Proposal for Backpack file format [skip ci]

Signed-off-by: Edward Z. Yang <>
4 years agoUpdate `process` submodule to pull in Safe Haskell fixes
David Terei [Tue, 9 Dec 2014 07:18:13 +0000 (23:18 -0800)] 
Update `process` submodule to pull in Safe Haskell fixes

4 years agocatch some recent typos
Gabor Greif [Mon, 8 Dec 2014 22:01:55 +0000 (23:01 +0100)] 
catch some recent typos

4 years agoAdd doctest examples for Data.Maybe
Michael Orlitzky [Mon, 8 Dec 2014 17:27:16 +0000 (18:27 +0100)] 
Add doctest examples for Data.Maybe

To actually *run* the doctests, you need to do a little
hacking. Somewhere after the `GHC.Base` import, you'll need to reimport
`Maybe(..)` from `Prelude`, clobbering the `GHC.Base` definition. After
that, doctest should be runnable from the `Data/` directory.

Reviewed By: austin, hvr

Differential Revision:

4 years agoFix #9871 by clarifying documentation.
Richard Eisenberg [Mon, 8 Dec 2014 15:59:48 +0000 (10:59 -0500)] 
Fix #9871 by clarifying documentation.

4 years agoRAE's response to SPJ's question in flattening-notes
Richard Eisenberg [Mon, 8 Dec 2014 15:32:21 +0000 (10:32 -0500)] 
RAE's response to SPJ's question in flattening-notes

4 years agoRevise flattening-notes
Simon Peyton Jones [Mon, 8 Dec 2014 15:00:32 +0000 (15:00 +0000)] 
Revise flattening-notes

4 years agoRevise the inert-set invariants again
Simon Peyton Jones [Mon, 8 Dec 2014 13:23:31 +0000 (13:23 +0000)] 
Revise the inert-set invariants again

In particular this patch

- Accepts that rewriting with the inert CTyEqCans should be done recursively
  (hence removing the Bool result from flattenTyVarOuter)

- Refines the kick-out criterion, in paticular to avoid kick-out of (a -f-> ty)
  when f cannot rewrite f.  This is true of Wanteds and hence reduces kick-outs
  of Wanteds, perhaps by a lot

This stuff is not fully documented because the details are still settling, but
it's looking good.

(And it validates.)

This patch includes the testsuite wibbles.  perf/compiler/T5030 and
T5837 both improve in bytes-allocated (by 11% and 13% resp), which is
good.  I'm not sure which of today's short series of patches is
responsible, nor do I mind much.  (One could find out if necessary.)

4 years agoComments and variable names only, in type checking of (e1 $ e2)
Simon Peyton Jones [Mon, 8 Dec 2014 13:10:05 +0000 (13:10 +0000)] 
Comments and variable names only, in type checking of (e1 $ e2)

No change in behaviour

4 years agoImprove the treatment of AppTy equalities
Simon Peyton Jones [Mon, 8 Dec 2014 13:09:27 +0000 (13:09 +0000)] 
Improve the treatment of AppTy equalities

This patch is mainly just refactoring, but it improves performance a bit where
there is a nested chain of AppTys, and I think it's easier to understand.

4 years agoOptimise partitionFunEqs for the 'false' case
Simon Peyton Jones [Mon, 8 Dec 2014 11:50:21 +0000 (11:50 +0000)] 
Optimise partitionFunEqs for the 'false' case

In the examples from Trac #9872 we were getting a large set of inert CFunEqCans,
and partitioning them was taking ages.  This patch improves it somewhat by optimising
the partition for the case where the predicat is false.

The ticket has more info.

4 years agoComments only
Simon Peyton Jones [Thu, 4 Dec 2014 11:03:49 +0000 (11:03 +0000)] 
Comments only

4 years agoRemove `inline` from integer_gmp_mpn_import1()
Herbert Valerio Riedel [Mon, 8 Dec 2014 08:31:19 +0000 (09:31 +0100)] 
Remove `inline` from integer_gmp_mpn_import1()

This would cause problems w/ BuildFlavour=quickest

4 years agoAdd -I$1/$2/build/autogen to $1_$2_DIST_CC_OPTS
Herbert Valerio Riedel [Sun, 7 Dec 2014 15:55:26 +0000 (16:55 +0100)] 
Add -I$1/$2/build/autogen to $1_$2_DIST_CC_OPTS

This is closer to how `cabal` behaves and is required for cbits to
be able to `#include "cabal_macros.h"`

4 years agoAdded comments to flattening-notes
Richard Eisenberg [Sun, 7 Dec 2014 15:40:23 +0000 (10:40 -0500)] 
Added comments to flattening-notes

4 years agoUpdate `unix` submodule to latest snapshot
Herbert Valerio Riedel [Sat, 6 Dec 2014 21:45:22 +0000 (22:45 +0100)] 
Update `unix` submodule to latest snapshot

4 years agoSet proper `CTYPE` for POSIX `CGroup`
Herbert Valerio Riedel [Sat, 6 Dec 2014 17:07:25 +0000 (18:07 +0100)] 
Set proper `CTYPE` for POSIX `CGroup`

This fixes which is about
compile warnings due to incompatible pointer types of the kind

     warning: passing argument 5 of ‘getgrnam_r’ from incompatible pointer type
     HsInt32 ghc...(void* a1, void* a2, void* a3, HsWord64 a4, void** a5)
       {return getgrnam_r(a1, a2, a3, a4, a5);}

     note: expected ‘struct group ** __restrict__’ but argument is of type ‘void **’
     extern int getgrnam_r (const char *__restrict __name,

Signed-off-by: Herbert Valerio Riedel <>
4 years agoAdd ticket-ref to changelog entry (fup to 08610c1)
Herbert Valerio Riedel [Sat, 6 Dec 2014 08:31:16 +0000 (09:31 +0100)] 
Add ticket-ref to changelog entry (fup to 08610c1)

[skip ci]

4 years agoPortability: wc -l sometimes has leading spaces, trim them off.
Edward Z. Yang [Fri, 5 Dec 2014 23:50:53 +0000 (15:50 -0800)] 
Portability: wc -l sometimes has leading spaces, trim them off.

Summary: Signed-off-by: Edward Z. Yang <>

Test Plan: validate

Reviewers: austin

Subscribers: carter, thomie

Differential Revision:

4 years agoAdd references between Data.Traversable.for and Data.Foldable.for_ and co.
Baldur Blöndal [Fri, 5 Dec 2014 21:15:04 +0000 (15:15 -0600)] 
Add references between Data.Traversable.for and Data.Foldable.for_ and co.

Summary: This is an issue that sometimes comes up, see

Reviewers: hvr, ekmett, dfeuer, Mikolaj, austin

Reviewed By: ekmett, Mikolaj, austin

Subscribers: mjo

Projects: #ghc

Differential Revision:

4 years agoImplement `calloc{,Bytes,Array,Array0}` allocators
Alex Petrov [Fri, 5 Dec 2014 20:56:14 +0000 (14:56 -0600)] 
Implement `calloc{,Bytes,Array,Array0}` allocators

This adds zero-initialising versions of `malloc{,Bytes,Array,Array0}`

 * Add `calloc` and `callocBytes` to `Foreign.Marshal.Alloc`.
 * Add `callocArray` and `callocArray0` to `Foreign.Marshal.Array`.

Reviewers: ekmett, duncan, austin, hvr

Reviewed By: austin, hvr

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

Projects: #ghc

Differential Revision:

GHC Trac Issues: #9859

4 years agomsse flag handling: fix trac issue #9777
Denis Redozubov [Fri, 5 Dec 2014 20:55:19 +0000 (14:55 -0600)] 
msse flag handling: fix trac issue #9777

Signed-off-by: Denis Redozubov <>
SSE version handled by different dynamic flags

Signed-off-by: Denis Redozubov <>
Test Plan: validate

Reviewers: austin, jstolarek

Reviewed By: austin, jstolarek

Subscribers: kolmodin, thomie, carter

Differential Revision:

GHC Trac Issues: #9777

4 years agoAdd -fwarn-unticked-promoted-constructors to -Wall
Austin Seipp [Fri, 5 Dec 2014 20:52:29 +0000 (14:52 -0600)] 
Add -fwarn-unticked-promoted-constructors to -Wall

Signed-off-by: Austin Seipp <>
4 years agodocs: Update to reflect reality
Austin Seipp [Fri, 5 Dec 2014 20:50:45 +0000 (14:50 -0600)] 
docs: Update to reflect reality

The documentation on what warnings -W/-Wall enable was slightly out of
date, so lets fix that.

Signed-off-by: Austin Seipp <>
4 years agorenamer: fix trac issue #9778
Carlos Tomé [Fri, 5 Dec 2014 20:36:55 +0000 (14:36 -0600)] 
renamer: fix trac issue #9778

Summary: Added flag -fwarn-unticked-promoted-constructors

Test Plan: test T9778 under tests/rename/should_compile

Reviewers: jstolarek, simonpj, austin

Reviewed By: jstolarek, simonpj, austin

Subscribers: simonpj, goldfire, jstolarek, thomie, carter

Differential Revision:

GHC Trac Issues: #9778

4 years agoAdd notes about the inert CTyEqCans
Simon Peyton Jones [Fri, 5 Dec 2014 23:47:06 +0000 (23:47 +0000)] 
Add notes about the inert CTyEqCans

Work with Dimitrios

4 years agoDisable T8124 on Windows (uses pthreads)
Simon Marlow [Fri, 5 Dec 2014 09:53:06 +0000 (09:53 +0000)] 
Disable T8124 on Windows (uses pthreads)

4 years agoRevert "Revert "Add purgeObj() to remove the symbol table entries for an object""
Simon Marlow [Thu, 4 Dec 2014 10:12:26 +0000 (10:12 +0000)] 
Revert "Revert "Add purgeObj() to remove the symbol table entries for an object""

This reverts commit 7932b2adaecac6c86038176d909c20ad1b1f9604.

4 years agoRevert "Revert "Make the linker API thread-safe""
Simon Marlow [Thu, 4 Dec 2014 10:12:01 +0000 (10:12 +0000)] 
Revert "Revert "Make the linker API thread-safe""

Also includes a fix for the segfaults on Windows caused by the original
version of this patch.

This reverts commit 4b51194df4090d984f02c12128e868077660fb8b.

4 years agoCabal submodule update
Herbert Valerio Riedel [Thu, 4 Dec 2014 16:19:56 +0000 (17:19 +0100)] 
Cabal submodule update

This submodule update pulls in the fix

> Build C sources with `-fPIC` when GHC is using dynamic libraries.

4 years agoPrevent solveFlatWanteds from losing insolubles when using typechecker plugins
Adam Gundry [Thu, 4 Dec 2014 13:31:08 +0000 (13:31 +0000)] 
Prevent solveFlatWanteds from losing insolubles when using typechecker plugins

Summary: I've added a Note explaining the problem.

Test Plan:
validate; we don't have a very good story for testing plugins yet,
but I've verified that this does at least fix the bug in my plugin.

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: carter, thomie, gridaphobe, yav

Differential Revision:

4 years agoComments on TrieMap and unifier.
Edward Z. Yang [Thu, 4 Dec 2014 08:23:57 +0000 (00:23 -0800)] 
Comments on TrieMap and unifier.

Signed-off-by: Edward Z. Yang <>
4 years agocompiler: de-lhs deSugar/
Austin Seipp [Wed, 3 Dec 2014 18:46:28 +0000 (12:46 -0600)] 
compiler: de-lhs deSugar/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs typecheck/
Austin Seipp [Wed, 3 Dec 2014 18:46:17 +0000 (12:46 -0600)] 
compiler: de-lhs typecheck/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs simplStg/
Austin Seipp [Wed, 3 Dec 2014 18:45:58 +0000 (12:45 -0600)] 
compiler: de-lhs simplStg/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs stgSyn/
Austin Seipp [Wed, 3 Dec 2014 18:45:40 +0000 (12:45 -0600)] 
compiler: de-lhs stgSyn/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs simplCore/
Austin Seipp [Wed, 3 Dec 2014 18:45:25 +0000 (12:45 -0600)] 
compiler: de-lhs simplCore/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs hsSyn/
Austin Seipp [Wed, 3 Dec 2014 18:45:05 +0000 (12:45 -0600)] 
compiler: de-lhs hsSyn/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs basicTypes/
Austin Seipp [Wed, 3 Dec 2014 18:44:39 +0000 (12:44 -0600)] 
compiler: de-lhs basicTypes/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs specialise/
Austin Seipp [Wed, 3 Dec 2014 18:44:25 +0000 (12:44 -0600)] 
compiler: de-lhs specialise/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs iface/
Austin Seipp [Wed, 3 Dec 2014 18:44:13 +0000 (12:44 -0600)] 
compiler: de-lhs iface/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs utils/
Austin Seipp [Wed, 3 Dec 2014 18:44:03 +0000 (12:44 -0600)] 
compiler: de-lhs utils/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs coreSyn/
Austin Seipp [Wed, 3 Dec 2014 18:43:05 +0000 (12:43 -0600)] 
compiler: de-lhs coreSyn/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs rename/
Austin Seipp [Wed, 3 Dec 2014 18:42:50 +0000 (12:42 -0600)] 
compiler: de-lhs rename/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs prelude/
Austin Seipp [Wed, 3 Dec 2014 18:42:24 +0000 (12:42 -0600)] 
compiler: de-lhs prelude/

Signed-off-by: Austin Seipp <>
4 years agocompiler: de-lhs main/
Austin Seipp [Wed, 3 Dec 2014 18:41:58 +0000 (12:41 -0600)] 
compiler: de-lhs main/

Signed-off-by: Austin Seipp <>
4 years agoComments only
Simon Peyton Jones [Wed, 3 Dec 2014 13:38:55 +0000 (13:38 +0000)] 
Comments only

4 years agoMake annotations test case cleaning less aggressive
Joachim Breitner [Tue, 2 Dec 2014 22:56:52 +0000 (23:56 +0100)] 
Make annotations test case cleaning less aggressive

cf. a4ec0c92

4 years agoUpdate 32-bit performace numbers (has not been done for ages)
Simon Peyton Jones [Wed, 3 Dec 2014 07:58:22 +0000 (07:58 +0000)] 
Update 32-bit performace numbers (has not been done for ages)

4 years agoGenerate real (but empty) object files for signatures.
Edward Z. Yang [Tue, 2 Dec 2014 05:07:33 +0000 (21:07 -0800)] 
Generate real (but empty) object files for signatures.

It's not great, but it preserves a nice invariant that every Haskell
source file has an object file (we already have a hack in place ensure
this is the case for hs-boot files) and further ensures every package
has a library associated with it (which would not be the case if
the package had all signatures and we didn't make object files.)

Contains Cabal submodule update.

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

Reviewers: simonpj, austin

Subscribers: carter, thomie

Differential Revision:

4 years agoDeclare official GitHub home of libraries/parallel
Herbert Valerio Riedel [Tue, 2 Dec 2014 21:35:36 +0000 (22:35 +0100)] 
Declare official GitHub home of libraries/parallel

Effective immediately, pushing to the `libraries/parallel` submodule
requires pushing via ssh://

4 years agoMake `read . show = id` for Data.Fixed (fix #9240)
Brian McKenna [Tue, 2 Dec 2014 16:53:38 +0000 (17:53 +0100)] 
Make `read . show = id` for Data.Fixed (fix #9240)

The QuickCheck property now succeeds:

    prop :: Fixed B7 -> Bool
    prop a = read (show a) == a

This changes the Show instance for Fixed to round up, rather than down
when calculating a digit. This needs to happen because Read also
rounds down:

    data B7

    instance HasResolution B7 where
      resolution _ = 128

    1 / 128 = 0.0078125

    read "0.007" = (0.000 :: Fixed B7)

Here is an example of the change to Show:

    showFixed False (0.009 :: Fixed B7)

    -- Broken: "0.007"
    -- Fixed:  "0.008"

And now Read can continue to round down:

    read "0.008" = (0.0078125 :: Fixed B7)

Reviewed By: hvr, ekmett

Differential Revision:

4 years agoMake Natural's (.|.) really an OR operation (#9818)
Herbert Valerio Riedel [Tue, 2 Dec 2014 16:51:36 +0000 (17:51 +0100)] 
Make Natural's (.|.) really an OR operation (#9818)

Currently it's an AND when at least one of the operands is big.

Reviewed By: hvr

Differential Revision:

4 years agoUnique-ify the names of top-level auxiliary bindings in derived instances (Trac ...
Simon Peyton Jones [Tue, 2 Dec 2014 15:13:32 +0000 (15:13 +0000)] 
Unique-ify the names of top-level auxiliary bindings in derived instances (Trac #7947)

The problem and its solution are explained in
   Note [Auxiliary binders]
in TcGenDeriv

4 years agoFix another bug in deriving( Data ) for data families; Trac #4896
Simon Peyton Jones [Tue, 2 Dec 2014 13:20:33 +0000 (13:20 +0000)] 
Fix another bug in deriving( Data ) for data families; Trac #4896

If we have

   data family D a
   data instance D (a,b,c) = ... deriving( Data )

then we want to generate

   instance ... => Data (D (a,b,c)) where
     dataCast1 x = gcast1 x

The "1" here comes from the kind of D.  But the kind of the
*representation* TyCon is

   data Drep a b c = ....

ie Drep :: * -> * -> * -> *

So we must look for the *family* TyCon in this (rather horrible)
dataCast1 / dataCast2 binding.

4 years agoMinor refactoring of Edward's recent orphans patch (Trac #2182)
Simon Peyton Jones [Tue, 2 Dec 2014 12:11:52 +0000 (12:11 +0000)] 
Minor refactoring of Edward's recent orphans patch (Trac #2182)

This patch is all small stuff
  - Move VisibleOrphanModules from Module to InstEnv (with the other orphan stuff)
  - Move Notes about orphans from IfaceSyn to InstEnv (ditto)
  - Make use of the record field names in InstEnvs

4 years agoTest Trac #4921
Simon Peyton Jones [Tue, 2 Dec 2014 12:08:57 +0000 (12:08 +0000)] 
Test Trac #4921

4 years agoRename Untouchables to TcLevel
Simon Peyton Jones [Tue, 2 Dec 2014 11:13:56 +0000 (11:13 +0000)] 
Rename Untouchables to TcLevel

This is a long-overdue renaming
   Untouchables  -->   TcLevel
It is renaming only; no change in functionality.

We really wanted to get this done before the 7.10 fork.

4 years agoRemove references to SynTyCon. Fixes #9812
Jan Stolarek [Tue, 2 Dec 2014 12:57:46 +0000 (13:57 +0100)] 
Remove references to SynTyCon. Fixes #9812