ghc.git
4 years agorts/PrimOps.cmm: follow '_static_closure' update
Sergei Trofimovich [Thu, 2 Oct 2014 20:30:26 +0000 (21:30 +0100)] 
rts/PrimOps.cmm: follow '_static_closure' update

Caught by UNREG build failure:

      rts_dist_HC rts/dist/build/PrimOps.o
    /tmp/ghc8613_0/ghc8613_2.hc: In function 'cf8_entry':

    /tmp/ghc8613_0/ghc8613_2.hc:1942:13:
         error: 'base_ControlziExceptionziBase_nestedAtomically_static_closure' undeclared (first use in this function)
         R1.w = (W_)&base_ControlziExceptionziBase_nestedAtomically_static_closure;
                     ^

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoUse dropWhileEndLE p instead of reverse . dropWhile p . reverse
David Feuer [Wed, 1 Oct 2014 21:34:29 +0000 (23:34 +0200)] 
Use dropWhileEndLE p instead of reverse . dropWhile p . reverse

Summary: Using `dropWhileEndLE` tends to be faster and easier to read
than the `reverse . dropWhile p . reverse` idiom. This also cleans up
some other, nearby, messes. Fix #9616 (incorrect number formatting
potentially leading to incorrect numbers in output).

Test Plan: Run validate

Reviewers: thomie, rwbarton, nomeata, austin

Reviewed By: nomeata, austin

Subscribers: simonmar, ezyang, carter, thomie

Projects: #ghc

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

GHC Trac Issues: #9623, #9616

Conflicts:
compiler/basicTypes/OccName.lhs

4 years agoRevert "Use dropWhileEndLE p instead of reverse . dropWhile p . reverse"
Austin Seipp [Thu, 2 Oct 2014 19:51:34 +0000 (14:51 -0500)] 
Revert "Use dropWhileEndLE p instead of reverse . dropWhile p . reverse"

This reverts commit 2a8856884de7d476e26b4ffa829ccb3a14d6f63e.

4 years agoRename _closure to _static_closure, apply naming consistently.
Edward Z. Yang [Mon, 26 Aug 2013 22:23:15 +0000 (15:23 -0700)] 
Rename _closure to _static_closure, apply naming consistently.

Summary:
In preparation for indirecting all references to closures,
we rename _closure to _static_closure to ensure any old code
will get an undefined symbol error.  In order to reference
a closure foobar_closure (which is now undefined), you should instead
use STATIC_CLOSURE(foobar).  For convenience, a number of these
old identifiers are macro'd.

Across C-- and C (Windows and otherwise), there were differing
conventions on whether or not foobar_closure or &foobar_closure
was the address of the closure.  Now, all foobar_closure references
are addresses, and no & is necessary.

CHARLIKE/INTLIKE were not changed, simply alpha-renamed.

Part of remove HEAP_ALLOCED patch set (#8199)

Depends on D265

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

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

GHC Trac Issues: #8199

4 years agoProperly generate info tables for static closures in C--.
Edward Z. Yang [Thu, 29 Aug 2013 05:07:07 +0000 (22:07 -0700)] 
Properly generate info tables for static closures in C--.

Summary:
Previously, we assumed all objects declared in C-- were not-static, even
ones which were CONSTR_NOCAF_STATIC.  This used to be harmless, but now
we need this information to be correct.

Part of remove HEAP_ALLOCED patch set (#8199)

Depends on D264

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

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

GHC Trac Issues: #8199

4 years agoBC-breaking changes to C-- CLOSURE syntax.
Edward Z. Yang [Mon, 26 Aug 2013 21:52:37 +0000 (14:52 -0700)] 
BC-breaking changes to C-- CLOSURE syntax.

Summary:
Previously, there were two variants of CLOSURE in C--:

    - Top-level CLOSURE(foo_closure, foo, lits...), which defines a new
      static closure and gives it a name, and

    - Array CLOSURE(foo, lits...), which was used for the static char
      and integer arrays.

They used the same name, were confusing, and didn't even generate
the correct internal label representation!  So now, we have two
new forms:

    - Top-level CLOSURE(foo, lits...) which automatically generates
      foo_closure (along with foo_info, which we were doing already)

    - Array ANONYMOUS_CLOSURE(foo, lits...) which doesn't generate
      a foo_closure identifier.

Part of remove HEAP_ALLOCED patch set (#8199)

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

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

GHC Trac Issues: #8199

4 years agoPlace static closures in their own section.
Edward Z. Yang [Mon, 26 Aug 2013 20:34:15 +0000 (13:34 -0700)] 
Place static closures in their own section.

Summary:
The primary reason for doing this is assisting debuggability:
if static closures are all in the same section, they are
guaranteed to be adjacent to one another.  This will help
later when we add some code that takes section start/end and
uses this to sanity-check the sections.

Part of remove HEAP_ALLOCED patch set (#8199)

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

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

GHC Trac Issues: #8199

4 years agoUse LinkerInternals.h for exitLinker.
Edward Z. Yang [Tue, 9 Sep 2014 19:03:48 +0000 (12:03 -0700)] 
Use LinkerInternals.h for exitLinker.

Part of remove HEAP_ALLOCED patch set (#8199)

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

Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

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

GHC Trac Issues: #8199

4 years agoBasic Python 3 support for testsuite driver (Trac #9184)
Krzysztof Gogolewski [Wed, 1 Oct 2014 21:41:27 +0000 (23:41 +0200)] 
Basic Python 3 support for testsuite driver (Trac #9184)

Summary:
Most of the changes is adaptation of old Python 2 only code.
My priority was not breaking Python 2, and so I avoided bigger
changes to the driver. In particular, under Python 3 the output
is a str and buffering cannot be disabled.

To test, define PYTHON=python3 in testsuite/mk/boilerplate.mk.

Thanks to aspidites <emarshall85@gmail.com> who provided the initial patch.

Test Plan: validate under 2 and 3

Reviewers: hvr, simonmar, thomie, austin

Reviewed By: thomie, austin

Subscribers: aspidites, thomie, simonmar, ezyang, carter

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

GHC Trac Issues: #9184

4 years agoUse dropWhileEndLE p instead of reverse . dropWhile p . reverse
David Feuer [Wed, 1 Oct 2014 21:34:29 +0000 (23:34 +0200)] 
Use dropWhileEndLE p instead of reverse . dropWhile p . reverse

Summary: Using `dropWhileEndLE` tends to be faster and easier to read
than the `reverse . dropWhile p . reverse` idiom. This also cleans up
some other, nearby, messes. Fix #9616 (incorrect number formatting
potentially leading to incorrect numbers in output).

Test Plan: Run validate

Reviewers: thomie, rwbarton, nomeata, austin

Reviewed By: nomeata, austin

Subscribers: simonmar, ezyang, carter, thomie

Projects: #ghc

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

GHC Trac Issues: #9623, #9616

Conflicts:
compiler/basicTypes/OccName.lhs

4 years ago[ci skip] Kill unused count_bytes script
Austin Seipp [Wed, 1 Oct 2014 21:36:59 +0000 (16:36 -0500)] 
[ci skip] Kill unused count_bytes script

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] Kill tabs in md5.h
Austin Seipp [Wed, 1 Oct 2014 21:35:39 +0000 (16:35 -0500)] 
[ci skip] Kill tabs in md5.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] compiler: Kill last remaining tabs in CallArity
Austin Seipp [Wed, 1 Oct 2014 21:34:11 +0000 (16:34 -0500)] 
[ci skip] compiler: Kill last remaining tabs in CallArity

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts/includes: Fix up .dir-locals.el
Austin Seipp [Wed, 1 Oct 2014 21:28:46 +0000 (16:28 -0500)] 
rts/includes: Fix up .dir-locals.el

After 23bb90460, these were slightly busted for `c-mode`.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoupdate cabal submodule to fix build failure on Solaris
Karel Gardas [Wed, 1 Oct 2014 20:48:13 +0000 (22:48 +0200)] 
update cabal submodule to fix build failure on Solaris

4 years agoFirst stab at making ./validate less verbose
Austin Seipp [Wed, 1 Oct 2014 20:01:25 +0000 (15:01 -0500)] 
First stab at making ./validate less verbose

Summary:
When we run `./validate`, we are typically given an incredibly large
heap of information, a large majority of which isn't really
necessary. In particular, we don't really care about what `make` is
doing, nor `ghc` itself most of the time.

This reduces some of the output by making `./validate` quietier. By
running:

  $ ./validate --quiet

you'll enable `V=0` in the build, suppressing compiler messages, and
you will suppress `make` commands by running `make` in 'silent
mode'. It also runs the testsuite with `VERBOSE=2` to avoid extra
lines. This alone makes quite a difference for build log sizes.

Furthermore, by making the build logs less verbose, life is easier for
systems like Harbormaster and Travis-CI, which dislike dealing with
logs that are 10k lines or more.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: iiam

Reviewers: hvr, nomeata, ezyang

Reviewed By: ezyang

Subscribers: simonmar, ezyang, carter, thomie

Projects: #ghc

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

4 years agoSimplify mergeSATInfo by using zipWith
David Feuer [Wed, 1 Oct 2014 14:02:45 +0000 (16:02 +0200)] 
Simplify mergeSATInfo by using zipWith

Closes #9561.

4 years agoMake filterM a good consumer
David Feuer [Wed, 1 Oct 2014 13:59:39 +0000 (15:59 +0200)] 
Make filterM a good consumer

analogously to mapM. Fixes #9546.

4 years agoFusion rule for "foldr k z (x:build g)"
David Feuer [Wed, 1 Oct 2014 13:57:27 +0000 (15:57 +0200)] 
Fusion rule for "foldr k z (x:build g)"

There seem to be various issues with general fold/cons and even
cons/build rules, but it seems pretty clear to me that the simple
fold/cons/build rule is a good idea. It doesn't do much for nofib
allocation, but it seems to improve some other analyses and speed
several benchmarks up. Implements #9536.

4 years agoMake mapAccumL a good consumer
David Feuer [Wed, 1 Oct 2014 13:42:27 +0000 (15:42 +0200)] 
Make mapAccumL a good consumer

This fixes #9502.

4 years agoMake scanr a good producer and consumer
David Feuer [Wed, 1 Oct 2014 13:24:43 +0000 (15:24 +0200)] 
Make scanr a good producer and consumer

This fixes #9355.

4 years agoMake foldr2 a bit more strict
David Feuer [Wed, 1 Oct 2014 13:02:33 +0000 (15:02 +0200)] 
Make foldr2 a bit more strict

in order to make its RULES semantics preserving. This fixes #9495.

4 years agoUpdate Win32 submodule to avoid potential -Werror failure
Herbert Valerio Riedel [Wed, 1 Oct 2014 15:53:14 +0000 (17:53 +0200)] 
Update Win32 submodule to avoid potential -Werror failure

4 years agoDon't use newSysLocal etc for Coercible
Simon Peyton Jones [Wed, 1 Oct 2014 13:39:42 +0000 (14:39 +0100)] 
Don't use newSysLocal etc for Coercible

The code is smaller and simpler now.  Thanks to Richard for
raising the question.

4 years agoComments about the let/app invariant
Simon Peyton Jones [Wed, 1 Oct 2014 13:39:00 +0000 (14:39 +0100)] 
Comments about the let/app invariant

4 years agoFix bogus comment
Simon Peyton Jones [Wed, 1 Oct 2014 09:08:58 +0000 (10:08 +0100)] 
Fix bogus comment

4 years agoUpdate hsc2hs submodule
Joachim Breitner [Wed, 1 Oct 2014 09:45:44 +0000 (11:45 +0200)] 
Update hsc2hs submodule

to get David’s code improvements (#9654).

4 years agoAdd emacs indentation/line-length settings
Simon Marlow [Fri, 26 Sep 2014 19:16:37 +0000 (20:16 +0100)] 
Add emacs indentation/line-length settings

4 years agoRevert "rts: add Emacs 'Local Variables' to every .c file"
Simon Marlow [Fri, 26 Sep 2014 19:11:25 +0000 (20:11 +0100)] 
Revert "rts: add Emacs 'Local Variables' to every .c file"

This reverts commit 39b5c1cbd8950755de400933cecca7b8deb4ffcd.

4 years agoDocument that -dynamic is needed for loading compiled code into GHCi
Simon Marlow [Tue, 2 Sep 2014 08:01:45 +0000 (09:01 +0100)] 
Document that -dynamic is needed for loading compiled code into GHCi

4 years agobugfix: EventCapsetID should be EventThreadID
Simon Marlow [Sat, 5 Jul 2014 19:56:17 +0000 (20:56 +0100)] 
bugfix: EventCapsetID should be EventThreadID

4 years agoFixup nofib submodule to cope with e5cca4ab246ca2
Herbert Valerio Riedel [Mon, 29 Sep 2014 10:40:19 +0000 (12:40 +0200)] 
Fixup nofib submodule to cope with e5cca4ab246ca2

4 years agoExtend `Foldable` class with `length` and `null` methods
Herbert Valerio Riedel [Sun, 28 Sep 2014 11:02:53 +0000 (13:02 +0200)] 
Extend `Foldable` class with `length` and `null` methods

This completes the `Foldable` class by two important operations which
this way can be optimised for the underlying structure more easily.

A minor fix for the `containers` submodule was needed to due name clash

Addresses #9621

Reviewed By: ekmett, dfeuer, austin

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

4 years agoGeneralise `guard` for real this time
Herbert Valerio Riedel [Sun, 28 Sep 2014 10:01:13 +0000 (12:01 +0200)] 
Generalise `guard` for real this time

This was missed in D253 / a07ce1654ac5b8033f2daf9270c6e182415b69ca

4 years agoGeneralise `Control.Monad.{when,unless,guard}`
Herbert Valerio Riedel [Sun, 28 Sep 2014 06:46:07 +0000 (08:46 +0200)] 
Generalise `Control.Monad.{when,unless,guard}`

Generalise `when`/`unless`from `Monad` to `Applicative` and `guard` from
`MonadPlus` to `Alternative` respectively.

This was made possible by the AMP and is somewhat related to #9586
(but generalising in the context of the AMP instead of the FTP)

Reviewed By: ekmett, austin

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

4 years agoUser's Guide: Fix compiler plugin example (#9641, #7682)
Reid Barton [Sun, 28 Sep 2014 02:13:10 +0000 (22:13 -0400)] 
User's Guide: Fix compiler plugin example (#9641, #7682)

The previous fix was incorrectly eta-reduced.

4 years agoSet default-impl of `mapM`/`sequence` methods to `traverse`/`sequenceA`
Herbert Valerio Riedel [Sat, 27 Sep 2014 20:55:19 +0000 (22:55 +0200)] 
Set default-impl of `mapM`/`sequence` methods to `traverse`/`sequenceA`

This is made possible by the AMP, as we don't need the `WrappedMonad`
helper for that anymore.

Approved-by: Edward Kmett <ekmett@gmail.com>
4 years agoStop exporting, and stop using, functions marked as deprecated
Thomas Miedema [Sat, 27 Sep 2014 11:55:48 +0000 (13:55 +0200)] 
Stop exporting, and stop using, functions marked as deprecated

Don't export `getUs` and `getUniqueUs`. `UniqSM` has a `MonadUnique` instance:

    instance MonadUnique UniqSM where
        getUniqueSupplyM = getUs
        getUniqueM  = getUniqueUs
        getUniquesM = getUniquesUs

Commandline-fu used:

    git grep -l 'getUs\>' |
        grep -v compiler/basicTypes/UniqSupply.lhs |
        xargs sed -i 's/getUs/getUniqueSupplyM/g

    git grep -l 'getUniqueUs\>' |
        grep -v combiler/basicTypes/UniqSupply.lhs |
        xargs sed -i 's/getUniqueUs/getUniqueM/g'

Follow up on b522d3a3f970a043397a0d6556ca555648e7a9c3

Reviewed By: austin, hvr

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

4 years agoReplace obsolete `defaultUserHooks` by `autoconfUserHooks`
Herbert Valerio Riedel [Sat, 27 Sep 2014 07:57:24 +0000 (09:57 +0200)] 
Replace obsolete `defaultUserHooks` by `autoconfUserHooks`

This also updates a few submodules

4 years agoUpdate Cabal submodule to latest master branch tip
Herbert Valerio Riedel [Fri, 26 Sep 2014 19:42:55 +0000 (21:42 +0200)] 
Update Cabal submodule to latest master branch tip

4 years agoDon't re-export `Alternative(..)` from Control.Monad (re #9586)
Herbert Valerio Riedel [Fri, 26 Sep 2014 19:09:56 +0000 (21:09 +0200)] 
Don't re-export `Alternative(..)` from Control.Monad (re #9586)

This was done in d94de87252d0fe2ae97341d186b03a2fbe136b04 to avoid orphans
but since a94dc4c3067c6a0925e2e39f35ef0930771535f1 moved `Alternative`
into GHC.Base, this isn't needed anymore.

This is important, as otherwise this would require a non-neglectable amount
of `Control.Monad hiding ((<|>), empty)` imports in user code.

The Haddock submodule is updated as well

Test Plan: partial local ./validate --fast, let Harbormaster doublecheck it

Reviewed By: ekmett, austin

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

4 years agoUpdate `unix` submodule to disable getlogin tests
Herbert Valerio Riedel [Fri, 26 Sep 2014 17:36:28 +0000 (19:36 +0200)] 
Update `unix` submodule to disable getlogin tests

4 years agoComments
Simon Peyton Jones [Fri, 26 Sep 2014 13:42:40 +0000 (14:42 +0100)] 
Comments

4 years agoThis test should have -XDataKinds
Simon Peyton Jones [Fri, 26 Sep 2014 13:42:26 +0000 (14:42 +0100)] 
This test should have -XDataKinds

4 years agoDe-tabify and remove trailing whitespace
Simon Peyton Jones [Fri, 26 Sep 2014 11:58:41 +0000 (12:58 +0100)] 
De-tabify and remove trailing whitespace

4 years agoComplain about illegal type literals in renamer, not parser
Simon Peyton Jones [Fri, 26 Sep 2014 11:34:13 +0000 (12:34 +0100)] 
Complain about illegal type literals in renamer, not parser

A premature complaint was causing Trac #9634.  Acutally this
change also simplifies the lexer and eliminates duplication.
(The renamer was already making the check, as it happens.)

4 years agoTwo improved error messages
Simon Peyton Jones [Fri, 26 Sep 2014 09:54:23 +0000 (10:54 +0100)] 
Two improved error messages

I'm not quite sure why these have improved following the previous
four commits, but I'm quite happy about it

4 years agoImprove error messages from functional dependencies
Simon Peyton Jones [Fri, 26 Sep 2014 09:53:32 +0000 (10:53 +0100)] 
Improve error messages from functional dependencies

Reponding to Trac #9612:

 * Track the CtOrigin of a Derived equality, arising from a
   functional dependency

 * And report it clearly in the error stream

This relies on a previous commit, in which I stop dropping Derived
insolubles on the floor.

4 years agoWibble to implicit-parameter error message
Simon Peyton Jones [Fri, 26 Sep 2014 09:48:25 +0000 (10:48 +0100)] 
Wibble to implicit-parameter error message

4 years agoDo not discard insoluble Derived constraints
Simon Peyton Jones [Fri, 26 Sep 2014 09:44:46 +0000 (10:44 +0100)] 
Do not discard insoluble Derived constraints

This is preparing for a fix to Trac #9612. The idea is that insoluble
constraints are nice solid errors that we should not discard before
we have a chance to report them.  So TcRnTypes.dropDerivedWC now
keeps insoluble Derived constrains, and instead TcSimplify.solve_wanteds
filters them out

We get somewhat better error message for kind-equality failures too.

A slight downside is that to avoid *duplicate* kind-equality failures
when we float a kind-incompatible equality (e.g.  alpha:* ~ Int#),
I've disabled constraint-floating when there are insolubles.  But that
in turn makes a handful of error messages a little less informative;
good examples are mc21, mc22, mc25.  But I am re-jigging the
constraint floating machinery in another branch, which will make this
go back to the way it was before.

4 years agoDefer errors in derived instances
Simon Peyton Jones [Wed, 24 Sep 2014 10:22:52 +0000 (11:22 +0100)] 
Defer errors in derived instances

Fixes Trac #9576.  Turned out to be pretty easy.

4 years agoFixes cyclic import on OS X(#9635)
Dave Laing [Fri, 26 Sep 2014 04:11:01 +0000 (23:11 -0500)] 
Fixes cyclic import on OS X(#9635)

Summary: Signed-off-by: Dave Laing <dave.laing.80@gmail.com>

Test Plan: Locally tested

Reviewers: thomie, austin

Reviewed By: thomie, austin

Subscribers: simonmar, ezyang, carter, thomie

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

GHC Trac Issues: #9635

4 years agoUser's Guide: various unfolding-related fixes
Reid Barton [Fri, 26 Sep 2014 04:10:50 +0000 (23:10 -0500)] 
User's Guide: various unfolding-related fixes

Test Plan: harbormaster

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter, thomie

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

4 years agoDelete hack that was once needed to fix the build
Thomas Miedema [Fri, 26 Sep 2014 04:10:33 +0000 (23:10 -0500)] 
Delete hack that was once needed to fix the build

Summary:
Introduced in 6c7b41cc2b24f533697a62bf1843507ae043fc97.

I checked the rest of that commit, and this is all that was left to revert.

Test Plan: x

Reviewers: ezyang, austin

Reviewed By: ezyang, austin

Subscribers: simonmar, ezyang, carter, thomie

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

4 years agoRefer to 'mask' instead of 'block' in Control.Exception
Thomas Miedema [Fri, 26 Sep 2014 04:10:18 +0000 (23:10 -0500)] 
Refer to 'mask' instead of 'block' in Control.Exception

Summary: More thorough version of a75383cdd46f7bb593639bc6d1628b068b78262a

Test Plan:
change of comments only

[skip ci]

Reviewers: austin, simonmar, ekmett

Reviewed By: austin, ekmett

Subscribers: simonmar, ezyang, carter

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

4 years agotypes: detabify/dewhitespace Unify
Austin Seipp [Fri, 26 Sep 2014 04:07:07 +0000 (23:07 -0500)] 
types: detabify/dewhitespace Unify

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] typecheck: detabify/dewhitespace TcUnify
Austin Seipp [Fri, 26 Sep 2014 04:06:19 +0000 (23:06 -0500)] 
[ci skip] typecheck: detabify/dewhitespace TcUnify

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] typecheck: detabify/dewhitespace TcTyDecls
Austin Seipp [Fri, 26 Sep 2014 04:05:54 +0000 (23:05 -0500)] 
[ci skip] typecheck: detabify/dewhitespace TcTyDecls

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] typecheck: detabify/dewhitespace TcPat
Austin Seipp [Fri, 26 Sep 2014 04:05:34 +0000 (23:05 -0500)] 
[ci skip] typecheck: detabify/dewhitespace TcPat

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] typecheck: detabify/dewhitespace TcInstDecls
Austin Seipp [Fri, 26 Sep 2014 04:05:20 +0000 (23:05 -0500)] 
[ci skip] typecheck: detabify/dewhitespace TcInstDecls

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] simplCore: detabify/dewhitespace CoreMonad
Austin Seipp [Fri, 26 Sep 2014 04:04:38 +0000 (23:04 -0500)] 
[ci skip] simplCore: detabify/dewhitespace CoreMonad

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years ago[ci skip] iface: detabify/dewhitespace IfaceSyn
Austin Seipp [Fri, 26 Sep 2014 04:03:53 +0000 (23:03 -0500)] 
[ci skip] iface: detabify/dewhitespace IfaceSyn

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoUpdate `binary` submodule in an attempt to address #9630
Herbert Valerio Riedel [Thu, 25 Sep 2014 20:19:32 +0000 (22:19 +0200)] 
Update `binary` submodule in an attempt to address #9630

This removes a couple of `INLINE` pragmas from the generics helper
classes. With this change the compile times and memory usage should
go back to the previous GHC 7.8.3 situation.

This has been submitted upstream as https://github.com/kolmodin/binary/pull/62

4 years agoDetab DataCon
Edward Z. Yang [Thu, 25 Sep 2014 09:39:12 +0000 (02:39 -0700)] 
Detab DataCon

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoRemove a few redundant `-fno-warn-tabs`s
Herbert Valerio Riedel [Thu, 25 Sep 2014 06:49:02 +0000 (08:49 +0200)] 
Remove a few redundant `-fno-warn-tabs`s

4 years agoLink from 7.6.3.4 to 7.7.2.6 in the user guide.
Jan Stolarek [Thu, 25 Sep 2014 08:18:15 +0000 (10:18 +0200)] 
Link from 7.6.3.4 to 7.7.2.6 in the user guide.

This point the user that there is a relation between the
UndecibadleInstances flag and the type families, not just type
classes.

4 years agoUpdate time submodule to 1.5.0 release
Herbert Valerio Riedel [Wed, 24 Sep 2014 22:38:28 +0000 (00:38 +0200)] 
Update time submodule to 1.5.0 release

4 years ago`M-x delete-trailing-whitespace` & `M-x untabify`
Herbert Valerio Riedel [Wed, 24 Sep 2014 21:47:00 +0000 (23:47 +0200)] 
`M-x delete-trailing-whitespace` & `M-x untabify`

4 years ago`M-x delete-trailing-whitespace` & `M-x untabify`
Herbert Valerio Riedel [Wed, 24 Sep 2014 21:42:55 +0000 (23:42 +0200)] 
`M-x delete-trailing-whitespace` & `M-x untabify`

...several modules in `base` recently touched by me

4 years agoUpdate Cabal submodule & ghc-pkg to use new module re-export types
Edward Z. Yang [Tue, 23 Sep 2014 14:05:25 +0000 (16:05 +0200)] 
Update Cabal submodule & ghc-pkg to use new module re-export types

Summary:
The main change is that Cabal changed the representation of module
re-exports to distinguish reexports in source .cabal files versus
re-exports in installed package registraion files.

Cabal now also does the resolution of re-exports to specific installed
packages itself, so ghc-pkg no longer has to do this. This is a cleaner
design overall because re-export resolution can fail so it is better to
do it during package configuration rather than package registration.
It also simplifies the re-export representation that ghc-pkg has to use.

Add extra ghc-pkg sanity check for module re-exports and duplicates

For re-exports, check that the defining package exists and that it
exposes the defining module (or for self-rexport exposed or hidden
modules). Also check that the defining package is actually a direct
or indirect dependency of the package doing the re-exporting.

Also add a check for duplicate modules in a package, including
re-exported modules.

Test Plan:
So far the sanity checks are totally untested. Should add some test
case to make sure the sanity checks do catch things correctly, and
don't ban legal things.

Reviewers: austin, duncan

Subscribers: angerman, simonmar, ezyang, carter

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

GHC Trac Issues:

4 years agoAdapt nofib submodule to #9586 changes
Herbert Valerio Riedel [Tue, 23 Sep 2014 21:46:11 +0000 (23:46 +0200)] 
Adapt nofib submodule to #9586 changes

4 years agoChange all hashbangs to /usr/bin/env (#9057)
Thomas Miedema [Tue, 23 Sep 2014 13:45:31 +0000 (08:45 -0500)] 
Change all hashbangs to /usr/bin/env (#9057)

Summary:
```
git grep -l '#!' | xargs sed -i 's|#!.*/bin/\([^ ]*\)$|#!/usr/bin/env \1|'
```
and some manual tweaking

Test Plan: harbormaster

Reviewers: austin

Subscribers: hvr, simonmar, ezyang, carter

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

GHC Trac Issues: #9057

4 years agoDelete all /* ! __GLASGOW_HASKELL__ */ code
Thomas Miedema [Tue, 23 Sep 2014 13:44:45 +0000 (08:44 -0500)] 
Delete all /* ! __GLASGOW_HASKELL__ */ code

Summary:
```
git grep -l '\(#ifdef \|#if defined\)(\?__GLASGOW_HASKELL__)\?'
```

Test Plan: validate

Reviewers: rwbarton, hvr, austin

Reviewed By: rwbarton, hvr, austin

Subscribers: rwbarton, simonmar, ezyang, carter

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

4 years agoDelete hack when takeDirectory returns ""
Thomas Miedema [Tue, 23 Sep 2014 13:44:02 +0000 (08:44 -0500)] 
Delete hack when takeDirectory returns ""

Summary:
Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed
in 2010), takeDirectory "foo" returns ".", and not "", so this check is no
longer needed.

Other commits:
* Remove trailing whitespace
* Update comments for #2278

Test Plan: harbormaster

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #2034

4 years agoTest Trac #9565 and #9583
Simon Peyton Jones [Tue, 23 Sep 2014 11:09:07 +0000 (12:09 +0100)] 
Test Trac #9565 and #9583

4 years agoEnsure that loop breakers are computed when glomming
Simon Peyton Jones [Fri, 19 Sep 2014 13:51:54 +0000 (14:51 +0100)] 
Ensure that loop breakers are computed when glomming

This patch fixes Trac #9583, a loop in the simplifier.

I thought this was going to be very complicated but it turned out to
be very simple!  The occurrence analyser does something called
"glomming" if the application of imported RULES means that something
that didn't look recursive becomes recursive.  See `Note [Glomming]`
in `OccurAnal`.  Under these circumstances we group all the top-level
bindings into a single massive `Rec`.

But, crucially, I failed to repeat the occurrence analysis on this
glommed set of bindings.  That means that we weren't establishing the
right loop breakers (indeed there were no loop breakers whatsoever),
and that led immediately to the loop. The only surprising this is that
it didn't happen before.

4 years agoUpdate haskeline submodule to avoid -Werror failure
Herbert Valerio Riedel [Tue, 23 Sep 2014 06:42:55 +0000 (08:42 +0200)] 
Update haskeline submodule to avoid -Werror failure

This would occur only on Windows during `./validate`

4 years agoFix windows breakage from 5ed12810e0972b1e due to import cycles
Herbert Valerio Riedel [Mon, 22 Sep 2014 08:42:09 +0000 (10:42 +0200)] 
Fix windows breakage from 5ed12810e0972b1e due to import cycles

Refs #9586

4 years agoExport `Monoid(..)`/`Foldable(..)`/`Traversable(..)` from Prelude
Herbert Valerio Riedel [Sun, 21 Sep 2014 21:22:19 +0000 (23:22 +0200)] 
Export `Monoid(..)`/`Foldable(..)`/`Traversable(..)` from Prelude

This finally exposes also the methods of these 3 classes in the Prelude
in order to allow to define basic class instances w/o needing imports.

This almost completes the primary goal of #9586

NOTE: `fold`, `foldl'`, `foldr'`, and `toList` are not exposed yet,
      as they require upstream fixes for at least `containers` and
      `bytestring`, and are not required for defining basic instances.

Reviewed By: ekmett, austin

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

4 years agoGeneralise Data.List/Control.Monad to Foldable/Traversable
Herbert Valerio Riedel [Sun, 21 Sep 2014 17:15:46 +0000 (19:15 +0200)] 
Generalise Data.List/Control.Monad to Foldable/Traversable

This flips the switch and replaces the entities in
`Data.List`/`Control.Monad` conflicting with
`Data.{Foldable,Traversable}` with re-exports of the more general
versions.

As of this commit, the code below (which is also added as a test-case)
compiles w/o error.

    module XPrelude (module X) where

    import Control.Monad     as X
    import Data.Foldable     as X
    import Data.List         as X
    import Data.Monoid       as X
    import Data.Traversable  as X
    import Prelude           as X

This addresses #9568

Reviewed By: ekmett, austin

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

4 years agoMove `mapM` and `sequence` to GHC.Base and break import-cycles
Herbert Valerio Riedel [Sun, 21 Sep 2014 17:14:04 +0000 (19:14 +0200)] 
Move `mapM` and `sequence` to GHC.Base and break import-cycles

This simplifies the import graph and more importantly removes import
cycles that arise due to `Control.Monad` & `Data.List` importing
`Data.Traversable` (preparation for #9586)

Reviewed By: ekmett, austin

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

4 years agoMake libffi install into a predictable directory (#9620)
Reid Barton [Sun, 21 Sep 2014 12:53:37 +0000 (08:53 -0400)] 
Make libffi install into a predictable directory (#9620)

On some systems (depending on gcc multilib configuration) libffi
would install into libffi/build/inst/lib64 even though we configure
it with --libdir=libffi/build/inst/lib. There appears to be no way
to get libffi to install to a predictable directory "out of the box",
so we apply a small patch to Makefile.in. This is the same fix used
in Gentoo's ebuild (https://bugs.gentoo.org/show_bug.cgi?id=462814).

4 years agoUpdate haskell2010, haskell98, and array submodules
Herbert Valerio Riedel [Sun, 21 Sep 2014 09:27:08 +0000 (11:27 +0200)] 
Update haskell2010, haskell98, and array submodules

The changes are purely cleanups to improve forward compatibility
to help with the Foldable/Traversal changes ahead.

4 years agoSimplify import-graph a bit more
Herbert Valerio Riedel [Sun, 21 Sep 2014 08:46:19 +0000 (10:46 +0200)] 
Simplify import-graph a bit more

This is preparatory refactoring for avoiding import cycles
when `Data.Traversable` will be imported by `Control.Monad` and
`Data.List` for implementing #9586

4 years agoAdd missing changelog entries for current state of #9586
Herbert Valerio Riedel [Sat, 20 Sep 2014 21:58:12 +0000 (23:58 +0200)] 
Add missing changelog entries for current state of #9586

4 years agoGeneralise (some of) Data.List to Foldables (re #9568)
Herbert Valerio Riedel [Sat, 20 Sep 2014 21:50:06 +0000 (23:50 +0200)] 
Generalise (some of) Data.List to Foldables (re #9568)

This replaces the entities in Data.List conflicting with Data.Foldable
with re-exports of the generalised version from Data.Foldable.

As of this commit, the following compiles w/o error

    module XPrelude (module X) where

    import Control.Monad as X
    import Data.Foldable as X
    import Data.List as X
    import Prelude as X

Reviewed By: austin, dfeuer, ekmett

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

4 years agoTurn a few existing folds into `Foldable`-methods (#9621)
Herbert Valerio Riedel [Sat, 20 Sep 2014 21:43:23 +0000 (23:43 +0200)] 
Turn a few existing folds into `Foldable`-methods (#9621)

Turn `toList`, `elem`, `sum`, `product`, `maximum`, and `minimum` into
`Foldable` methods. This helps avoiding regressions (and semantic
differences) while implementing #9586

Reviewed By: austin, dfeuer, ekmett

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

4 years agoSet up framework for generalising Data.List to Foldables
Herbert Valerio Riedel [Sat, 20 Sep 2014 21:32:06 +0000 (23:32 +0200)] 
Set up framework for generalising Data.List to Foldables

This renames the Data.List module to Data.OldList, and puts a new
Data.List module into its place re-exporting all list functions.

The plan is to leave the monomorphic versions of the list functions in
Data.OldList to help smooth the transition.

The new Data.List module then will simply re-export entities from
Data.OldList and Data.Foldable.

This refactoring has been placed in a separate commit to be able to
better isolate any regressions caused by the actual list function
generalisations when implementing #9586

This also updates the haskell2010, haskell98, and array submodules

Reviewed By: austin, ekmett

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

4 years agoChange linker message verbosity to `-v2` (re #7863)
Herbert Valerio Riedel [Sat, 20 Sep 2014 19:23:28 +0000 (21:23 +0200)] 
Change linker message verbosity to `-v2` (re #7863)

With this change, the linker status logging output such as

    Loading package ghc-prim ... linking ... done.
    Loading package integer-gmp ... linking ... done.
    Loading package base ... linking ... done.

is suppressed unless verbosity level is `-v2` or higher. This is done
to reduce the compiler message noise when TH is involved, which can
reduce the visibiliy of compile warnings.

Reviewed By: ekmett, austin

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

4 years agoDeactive T4801 `max_bytes_used`-check & bump T3064 numbers
Herbert Valerio Riedel [Sat, 20 Sep 2014 19:19:28 +0000 (21:19 +0200)] 
Deactive T4801 `max_bytes_used`-check & bump T3064 numbers

T4801 is deactived for now because it's currently too volatile
and causes too much noise in Phabricator's CI

Reviewed By: austin

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

4 years agoFix potential `mingw32_HOST_OS` -Werror failure
Herbert Valerio Riedel [Sat, 20 Sep 2014 17:11:48 +0000 (19:11 +0200)] 
Fix potential `mingw32_HOST_OS` -Werror failure

4 years agoFix potential `mingw32_HOST_OS` breakage from eae19112462fe77
Herbert Valerio Riedel [Sat, 20 Sep 2014 15:37:24 +0000 (17:37 +0200)] 
Fix potential `mingw32_HOST_OS` breakage from eae19112462fe77

4 years agoTypos
Krzysztof Gogolewski [Fri, 19 Sep 2014 17:27:34 +0000 (19:27 +0200)] 
Typos

4 years agoDefine fixity for `Data.Foldable.{elem,notElem}`
Herbert Valerio Riedel [Fri, 19 Sep 2014 15:53:33 +0000 (17:53 +0200)] 
Define fixity for `Data.Foldable.{elem,notElem}`

This was probably just an oversight. With this change the fixity matches
that from `Data.List.{elem,notElem`}`.

Addresses #9610

Reviewed By: austin, ekmett

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

4 years agoFixup overlooked `unless` occurence
Herbert Valerio Riedel [Fri, 19 Sep 2014 14:49:20 +0000 (16:49 +0200)] 
Fixup overlooked `unless` occurence

This was broken in eae19112462fe77a3f1298bff12b409b205a581d

4 years agoClean up Coercible handling, and interaction of data families with newtypes
Simon Peyton Jones [Thu, 18 Sep 2014 15:19:55 +0000 (16:19 +0100)] 
Clean up Coercible handling, and interaction of data families with newtypes

This patch fixes Trac #9580, in which the Coercible machinery succeeded
even though the relevant data constructor was not in scope.

As usual I got dragged into a raft of refactoring changes,
all for the better.

* Delete TcEvidence.coercionToTcCoercion (now unused)

* Move instNewTyConTF_maybe, instNewTyCon_maybe to FamInst,
  and rename them to tcInstNewTyConTF_maybe, tcInstNewTyCon
  (They both return TcCoercions.)

* tcInstNewTyConTF_maybe also gets more convenient type,
  which improves TcInteract.getCoercibleInst

* Define FamInst.tcLookupDataFamInst, and use it in TcDeriv,
  (as well as in tcInstNewTyConTF_maybe)

* Improve error report for Coercible errors, when data familes
  are involved  Another use of tcLookupDataFamInst

* In TcExpr.tcTagToEnum, use tcLookupDataFamInst to replace
  local hacky code

* Fix Coercion.instNewTyCon_maybe and Type.newTyConInstRhs to deal
  with eta-reduced newtypes, using
  (new) Type.unwrapNewTyConEtad_maybe and (new) Type.applyTysX

Some small refactoring of TcSMonad.matchFam.

4 years agoWhite space only
Simon Peyton Jones [Thu, 18 Sep 2014 15:05:14 +0000 (16:05 +0100)] 
White space only

4 years agoDefine Util.leLength :: [a] -> [b] -> Bool
Simon Peyton Jones [Thu, 18 Sep 2014 15:04:41 +0000 (16:04 +0100)] 
Define Util.leLength :: [a] -> [b] -> Bool

4 years agoFix garbled comment wording
Simon Peyton Jones [Tue, 9 Sep 2014 12:00:18 +0000 (13:00 +0100)] 
Fix garbled comment wording

Thanks to Gabor for pointing this out

4 years agoTypo in comment in GHC.Generics
Simon Peyton Jones [Tue, 9 Sep 2014 11:58:25 +0000 (12:58 +0100)] 
Typo in comment in GHC.Generics

Fixes Trac #9523