5 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 <>
5 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

5 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

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

  $ ./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 <>
Test Plan: iiam

Reviewers: hvr, nomeata, ezyang

Reviewed By: ezyang

Subscribers: simonmar, ezyang, carter, thomie

Projects: #ghc

Differential Revision:

5 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.

5 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.

5 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.

5 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.

5 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.

5 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.

5 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

5 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.

5 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

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

5 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).

5 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

5 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.

5 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

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

5 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

5 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:

5 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

5 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:

5 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.

5 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 <>
5 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:

5 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

5 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

5 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:

5 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

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

5 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

5 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

5 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.)

5 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

5 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.

5 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

5 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.

5 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.

5 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 <>

Test Plan: Locally tested

Reviewers: thomie, austin

Reviewed By: thomie, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision:

GHC Trac Issues: #9635

5 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:

5 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

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:

5 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:

5 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 <>
5 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 <>
5 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 <>
5 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 <>
5 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 <>
5 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 <>
5 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 <>
5 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

5 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 <>
5 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

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

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

5 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

5 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`

5 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

5 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

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:

GHC Trac Issues:

5 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

5 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)

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:

GHC Trac Issues: #9057

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

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:

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

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:

GHC Trac Issues: #2034

5 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

5 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.

5 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`

5 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

5 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:

5 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

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:

5 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:

5 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 This is the same fix used
in Gentoo's ebuild (

5 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.

5 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

5 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

5 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:

5 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:

5 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:

5 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:

5 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:

5 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

5 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

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

5 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:

5 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

5 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.

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

5 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

5 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

5 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

5 years agoUse mapAccumL (refactoring only)
Simon Peyton Jones [Tue, 9 Sep 2014 11:57:04 +0000 (12:57 +0100)] 
Use mapAccumL (refactoring only)

Fixes Trac #9529

5 years agoSpelling error in flags.xml
Simon Peyton Jones [Tue, 9 Sep 2014 11:56:31 +0000 (12:56 +0100)] 
Spelling error in flags.xml

Fixes Trac #9528

5 years agoIncrease -fcontext-stack=N default to 100
Simon Peyton Jones [Tue, 9 Sep 2014 11:52:18 +0000 (12:52 +0100)] 
Increase -fcontext-stack=N default to 100

This addresses Trac #5395

5 years agoAuto-derive a few manually coded Show instances
Herbert Valerio Riedel [Fri, 19 Sep 2014 08:25:34 +0000 (10:25 +0200)] 
Auto-derive a few manually coded Show instances

In `base`, the instances

  instance Show ()
  instance Show Bool
  instance Show Ordering
  instance Show a => Show (Maybe a)

where defined manually, even though we can leverage GHC's auto-deriver
which is perfectly capable by standalone derivation to avoid boiler-plate
code such as this.

Reviewed By: austin

Differential Revision:

5 years agoRevert accidental wip/generics-propeq-conservative merge
Herbert Valerio Riedel [Fri, 19 Sep 2014 08:13:16 +0000 (10:13 +0200)] 
Revert accidental wip/generics-propeq-conservative merge

This commit reverts the commits

   e12a6a8 Propositional equality for Datatype meta-information
   0a8e6fc Make constructor metadata parametrized (with intended parameter <- datatype)
   f097b77 Implement sameConstructor
   cc618e6 get roles right and fix a FIXME
   79c7125 Actually parametrize the Constructor with the Datatype
   7bd4bab Supply a reasonable name (should be derived from d_name tho)
   09fcd70 Use 'd_name' as the name (should be derived from d_name tho)
   4d90e44 Add default case (fixes -Werror)

and effectively resets ghc.git to the state it was at commit

5 years agoAdd default case (fixes -Werror)
Gabor Greif [Fri, 19 Sep 2014 04:23:58 +0000 (06:23 +0200)] 
Add default case (fixes -Werror)

5 years agoUse 'd_name' as the name (should be derived from d_name tho)
Gabor Greif [Wed, 17 Sep 2014 08:56:20 +0000 (10:56 +0200)] 
Use 'd_name' as the name (should be derived from d_name tho)

5 years agoSupply a reasonable name (should be derived from d_name tho)
Gabor Greif [Wed, 17 Sep 2014 05:46:39 +0000 (07:46 +0200)] 
Supply a reasonable name (should be derived from d_name tho)

5 years agoActually parametrize the Constructor with the Datatype
Gabor Greif [Wed, 17 Sep 2014 04:43:21 +0000 (06:43 +0200)] 
Actually parametrize the Constructor with the Datatype

5 years agoget roles right and fix a FIXME
Gabor Greif [Tue, 16 Sep 2014 05:22:52 +0000 (07:22 +0200)] 
get roles right and fix a FIXME

5 years agoImplement sameConstructor
Gabor Greif [Tue, 2 Sep 2014 10:44:09 +0000 (12:44 +0200)] 
Implement sameConstructor

5 years agoMake constructor metadata parametrized (with intended parameter <- datatype)
Gabor Greif [Mon, 1 Sep 2014 21:52:01 +0000 (23:52 +0200)] 
Make constructor metadata parametrized (with intended parameter <- datatype)

5 years agoPropositional equality for Datatype meta-information
Gabor Greif [Fri, 29 Aug 2014 13:57:45 +0000 (15:57 +0200)] 
Propositional equality for Datatype meta-information