ghc.git
4 years agoFix broken Haddock markup in `Monad` documentation
Herbert Valerio Riedel [Tue, 16 Dec 2014 12:27:18 +0000 (13:27 +0100)] 
Fix broken Haddock markup in `Monad` documentation

4 years agoUse llvm-3.5 on Travis
Joachim Breitner [Tue, 16 Dec 2014 09:54:36 +0000 (10:54 +0100)] 
Use llvm-3.5 on Travis

to avoid a build failure with T5681(optllvm). According to Ben Gamari,
llvm-3.4 is known to be not working with GHC HEAD.

4 years ago*Really* Re-Update Haddock submodule
Herbert Valerio Riedel [Tue, 16 Dec 2014 07:56:37 +0000 (08:56 +0100)] 
*Really* Re-Update Haddock submodule

The actual gitlink update got lost in 0c9c2d899e63b810e7ab6b486f7244826b4a2e33

4 years agoTypo in feature description
Gabor Greif [Tue, 16 Dec 2014 09:08:19 +0000 (10:08 +0100)] 
Typo in feature description

4 years agoUpdate process submodule to latest 1.2.1.0 RC
Herbert Valerio Riedel [Tue, 16 Dec 2014 07:05:06 +0000 (08:05 +0100)] 
Update process submodule to latest 1.2.1.0 RC

4 years agoUpdate unix submodule to latest 2.7.1.0 snapshot
Herbert Valerio Riedel [Mon, 15 Dec 2014 22:36:06 +0000 (23:36 +0100)] 
Update unix submodule to latest 2.7.1.0 snapshot

4 years agoUpdate haskeline/terminfo submodules to master
Herbert Valerio Riedel [Mon, 15 Dec 2014 13:42:32 +0000 (14:42 +0100)] 
Update haskeline/terminfo submodules to master

4 years agocomments
Simon Marlow [Fri, 13 Dec 2013 20:06:40 +0000 (20:06 +0000)] 
comments

4 years agocomment about why this program exists
Simon Marlow [Fri, 13 Dec 2013 10:32:29 +0000 (10:32 +0000)] 
comment about why this program exists

4 years agoFix comments (#8254)
Simon Marlow [Tue, 1 Oct 2013 10:25:11 +0000 (11:25 +0100)] 
Fix comments (#8254)

4 years agostm: Update submodule (again) to fix build breakage
Austin Seipp [Mon, 15 Dec 2014 17:52:34 +0000 (11:52 -0600)] 
stm: Update submodule (again) to fix build breakage

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoWibbles to documentation for promoted lists and tuples (Trac #9882)
Simon Peyton Jones [Mon, 15 Dec 2014 17:40:45 +0000 (17:40 +0000)] 
Wibbles to documentation for promoted lists and tuples (Trac #9882)

4 years agoImprove documentation of syntax for promoted lists
Simon Peyton Jones [Mon, 15 Dec 2014 17:08:29 +0000 (17:08 +0000)] 
Improve documentation of syntax for promoted lists

THe documentation in 7.9.4 of promoted list and tuple types was
misleading, which led to Trac #9882.  This patch makes explicit
that only type-level with two or more elements can have the
quote omitted.

4 years agoFix dll-split problem with patch 'Make Core Lint check for locally-bound GlobalId'
Simon Peyton Jones [Mon, 15 Dec 2014 17:03:47 +0000 (17:03 +0000)] 
Fix dll-split problem with patch 'Make Core Lint check for locally-bound GlobalId'

The trouble was that my changes made a lot more files transitively link with
DynFlags, which is the root module for the revolting Windows dll-split stuff.

Anyway this patch fixes it, in a good way:

 - Make GHC/Hooks *not* import DsMonad, because DsMonad imports too
   much other stuff (notably tcLookup variants).  Really, Hooks depends
   only on *types* not *code*.

 - To do this I need the DsM type, and the types it depends on,
   not to be part of DsMonad.  So I moved it to TcRnTypes, which is
   where the similar pieces for the TcM and IfM monads live.

 - We can then delete DsMonad.hs-boot

 - There are a bunch of knock-on change, of no great significance

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)

Summary:
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: https://phabricator.haskell.org/D573

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: https://phabricator.haskell.org/D568

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

Summary:
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: https://phabricator.haskell.org/D350

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 <austin@well-typed.com>
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
find!

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 0.10.6.0 RC
Herbert Valerio Riedel [Sun, 14 Dec 2014 19:36:33 +0000 (20:36 +0100)] 
Update `bytestring` submodule to 0.10.6.0 RC

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

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 0.7.2.3 release
Herbert Valerio Riedel [Sun, 14 Dec 2014 17:59:00 +0000 (18:59 +0100)] 
Update `binary` submodule to final 0.7.2.3 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 1.3.1.0 RC
Herbert Valerio Riedel [Sun, 14 Dec 2014 13:01:13 +0000 (14:01 +0100)] 
Update `filepath` submodule to current 1.3.1.0 RC

4 years agoUpdate `time` submodule to final 1.5.0.1 release
Herbert Valerio Riedel [Sun, 14 Dec 2014 09:58:26 +0000 (10:58 +0100)] 
Update `time` submodule to final 1.5.0.1 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

Summary:
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 <siarheit@google.com>
Test Plan: validate passes equal amount of vanilla/dyn tests

Reviewers: simonmar, erikd, austin

Reviewed By: erikd, austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D560

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 <erikd@mega-nerd.com>

Reviewers: austin, carter

Reviewed By: carter

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D570

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)

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

Before:
  unused rules: 1
  shift/reduce conflicts:  60
  reduce/reduce conflicts: 16
After:
  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 <siarheit@google.com>
Reviewers: simonmar, austin, alanz

Reviewed By: alanz

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D569

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

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

A preliminary form of these ideas is at
https://ghc.haskell.org/trac/ghc/wiki/Design/NewCoercibleSolver

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: https://phabricator.haskell.org/D546

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
      ApplyToVal
      ApplyToTy
  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

Summary:
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
directly.

Reviewers: hvr, austin, rwbarton, simonmar

Reviewed By: austin, simonmar

Subscribers: simonmar, thomie, carter

Differential Revision: https://phabricator.haskell.org/D515

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 <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D567

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 <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D565

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

Summary:
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
machines.

Test Plan: It helped here.

Reviewers: bgamari, austin

Reviewed By: bgamari, austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D564

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

Summary:
`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: https://phabricator.haskell.org/D562

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

Summary:
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: https://phabricator.haskell.org/D556

GHC Trac Issues: #9605

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

Summary:
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
program.

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
0362-1340.
[2] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers
[3] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers/ImplementationPlan

Authored-by: Facundo Domínguez <facundo.dominguez@tweag.io>
Authored-by: Mathieu Boespflug <m@tweag.io>
Authored-by: Alexander Vershilov <alexander.vershilov@tweag.io>
Test Plan: `./validate`

Reviewers: hvr, simonmar, simonpj, austin

Reviewed By: simonpj, austin

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

Differential Revision: https://phabricator.haskell.org/D550

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 <ezyang@cs.stanford.edu>
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: https://phabricator.haskell.org/D561

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 https://github.com/haskell/unix/issues/20 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 <hvr@gnu.org>
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 <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D557

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
https://www.haskell.org/pipermail/libraries/2013-May/019872.html

Reviewers: hvr, ekmett, dfeuer, Mikolaj, austin

Reviewed By: ekmett, Mikolaj, austin

Subscribers: mjo

Projects: #ghc

Differential Revision: https://phabricator.haskell.org/D475

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

Summary:
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: https://phabricator.haskell.org/D527

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

Summary:
Signed-off-by: Denis Redozubov <denis.redozubov@gmail.com>
SSE version handled by different dynamic flags

Signed-off-by: Denis Redozubov <denis.redozubov@gmail.com>
Test Plan: validate

Reviewers: austin, jstolarek

Reviewed By: austin, jstolarek

Subscribers: kolmodin, thomie, carter

Differential Revision: https://phabricator.haskell.org/D504

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 <austin@well-typed.com>
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 <austin@well-typed.com>
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: https://phabricator.haskell.org/D534

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: https://phabricator.haskell.org/D552

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 <ezyang@cs.stanford.edu>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>
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 <austin@well-typed.com>