ghc.git
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>
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 <austin@well-typed.com>
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.

Summary:
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 <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin

Subscribers: carter, thomie

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

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://git@github.com/haskell/parallel.git.

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

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

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

4 years agoComments and formatting in TyCon
Jan Stolarek [Tue, 2 Dec 2014 09:42:49 +0000 (10:42 +0100)] 
Comments and formatting in TyCon

4 years agoFix test suite race on T5462 (solves intermittent T5462Yes1/T5462Yes2/T5462No1 failure)
Edward Z. Yang [Tue, 2 Dec 2014 11:12:14 +0000 (03:12 -0800)] 
Fix test suite race on T5462 (solves intermittent T5462Yes1/T5462Yes2/T5462No1 failure)

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoRevert "Make the linker API thread-safe"
Simon Peyton Jones [Tue, 2 Dec 2014 10:05:49 +0000 (10:05 +0000)] 
Revert "Make the linker API thread-safe"

This reverts commit b5e8b3b162b3ff15ae6caf1afc659565365f54a8.

I reverted it because one of these two patches
  9e6e4796437a7fc23e83605a45db9b2663570123 Add purgeObj()
  b5e8b3b162b3ff15ae6caf1afc659565365f54a8 Make the linker API thread-safe

causes a seg-fault on Windows.  The seg-fault happens immediately
the linker is invoked, in ghci or in Template Haskell.

I believe that it is the "linker API thread-safe" commit that causes
the seg-fault; it happens even if the "purgeObj" commit alone is
reverted.  But since the two patches mess with the same code, to
revert the "linker API" patch I had revert both.

4 years agoRevert "Add purgeObj() to remove the symbol table entries for an object"
Simon Peyton Jones [Mon, 1 Dec 2014 22:39:12 +0000 (22:39 +0000)] 
Revert "Add purgeObj() to remove the symbol table entries for an object"

This reverts commit 9e6e4796437a7fc23e83605a45db9b2663570123.

I reverted it because one of these two patches
  9e6e4796437a7fc23e83605a45db9b2663570123 Add purgeObj()
  b5e8b3b162b3ff15ae6caf1afc659565365f54a8 Make the linker API thread-safe

causes a seg-fault on Windows.  The seg-fault happens immediately
the linker is invoked, in ghci or in Template Haskell.

I believe that it is the "linker API thread-safe" commit that causes
the seg-fault; it happens even if the "purgeObj" commit alone is
reverted.  But since the two patches mess with the same code, to
revert the "linker API" patch I had revert both.

4 years agoUncomment the instance signatures, to activate the test
Simon Peyton Jones [Mon, 1 Dec 2014 22:29:18 +0000 (22:29 +0000)] 
Uncomment the instance signatures, to activate the test

4 years agoMention existence of 'Natural' in "Data.Word"
Herbert Valerio Riedel [Tue, 2 Dec 2014 07:38:38 +0000 (08:38 +0100)] 
Mention existence of 'Natural' in "Data.Word"

This replaces the note mentioning the lack of a `Natural`-type by a note
pointing to the new "Numeric.Natural" (#9818) module.

4 years agoFix malformed `configure` script
Herbert Valerio Riedel [Mon, 1 Dec 2014 20:30:10 +0000 (21:30 +0100)] 
Fix malformed `configure` script

Don't pass empty string `[]` as "action-if-not-given" to `AC_ARG_ENABLE()`
macro, as this would otherwise lead to an empty else-block in the resulting
bash `configure` script. This bug was introduced via cb0a503a.

This issue was pointed out by @christiaanb

Reviewed By: christiaanb

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

4 years agoFix parser for UNPACK pragmas
Simon Peyton Jones [Mon, 1 Dec 2014 17:07:48 +0000 (17:07 +0000)] 
Fix parser for UNPACK pragmas

   {-# NOUNPACK #-}
   {-# NOUNPACK #-} !
were being parsed the same way.  The former was wrong.

Thanks to Alan Zimmerman for pointing this out

4 years agoTest Trac #7908
Simon Peyton Jones [Mon, 1 Dec 2014 17:04:47 +0000 (17:04 +0000)] 
Test Trac #7908

Fixed by e6a2050ebb6da316aecec66a6795715fbab355ca
along with #9582, #9833

4 years agoRemove references to Parser.y.pp
Thomas Miedema [Mon, 1 Dec 2014 15:26:51 +0000 (09:26 -0600)] 
Remove references to Parser.y.pp

Summary:
Commit 37d64a51348a803a1cf974d9e97ec9231215064a removed the preprocessing step
for Parser.y.

Reviewers: rodlogic, austin

Reviewed By: austin

Subscribers: carter, thomie

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

4 years agoWibble to the "instance signatures" patch
Simon Peyton Jones [Mon, 1 Dec 2014 14:29:30 +0000 (14:29 +0000)] 
Wibble to the "instance signatures" patch

Sorry about this.  I somehow failed to include this one line in my patch.

4 years agoFix the handling of instance signatures (Trac #9582, #9833)
Simon Peyton Jones [Mon, 1 Dec 2014 11:43:20 +0000 (11:43 +0000)] 
Fix the handling of instance signatures (Trac #9582, #9833)

This finally solves the issue of instance-method signatures that are
more polymorphic than the instanted class method.

See Note [Instance method signatures] in TcInstDcls.

A very nice fix for the two Trac tickets above.

4 years agounlit compiler/types/ modules
Herbert Valerio Riedel [Mon, 1 Dec 2014 09:52:09 +0000 (10:52 +0100)] 
unlit compiler/types/ modules

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

4 years agounlit compiler/stranal/ modules
Herbert Valerio Riedel [Mon, 1 Dec 2014 07:45:16 +0000 (08:45 +0100)] 
unlit compiler/stranal/ modules

Reviewed By: austin

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

4 years agoRevert "Remove RAWCPP_FLAGS"
Herbert Valerio Riedel [Mon, 1 Dec 2014 07:37:09 +0000 (08:37 +0100)] 
Revert "Remove RAWCPP_FLAGS"

This reverts commit 460eebec65811c6a7bbe11645df322dda868e80d.

Thomas requested to revert the commit with the words:

> Please revert this commit, it is horribly wrong. I'll have a proper look
> later, but not supplying `-traditional` to the C preprocessor is the cause
> of #9828.

the reverted commit was related to #9094

4 years agoUnlit AsmCodeGen.lhs
Herbert Valerio Riedel [Sun, 30 Nov 2014 21:56:16 +0000 (22:56 +0100)] 
Unlit AsmCodeGen.lhs

Fwiw, this wasn't really a proper .lhs to begin with...

4 years agoUnlit compiler/cmm/ module(s)
Herbert Valerio Riedel [Sun, 30 Nov 2014 21:58:29 +0000 (15:58 -0600)] 
Unlit compiler/cmm/ module(s)

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoUpdate docs: instance visibility bug is no more.
Edward Z. Yang [Sun, 30 Nov 2014 19:45:08 +0000 (11:45 -0800)] 
Update docs: instance visibility bug is no more.

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