5 years agoRejig builders for pattern synonyms, especially unlifted ones
Simon Peyton Jones [Fri, 21 Nov 2014 10:04:09 +0000 (10:04 +0000)] 
Rejig builders for pattern synonyms, especially unlifted ones

When a pattern synonym is for an unlifted pattern, its "builder" would
naturally be a top-level unlifted binding, which isn't allowed.  So we
give it an extra Void# argument.

Our Plan A involved then making *two* Ids for these builders, with
some consequential fuss in the desugarer.  This was more pain than I
liked, so I've re-jigged it.

 * There is just one builder for a pattern synonym.

 * It may have an extra Void# arg, but this decision is signalled
   by the Bool in the psBuilder field.

   I did the same for the psMatcher field.

   Both Bools are serialised into interface files, so there is
   absolutely no doubt whether that extra Void# argument is required.

 * I renamed "wrapper" to "builder".  We have too may "wrappers"

 * In order to deal with typecchecking occurrences of P in expressions,
   I refactored the tcInferId code in TcExpr.

All of this allowed me to revert 5fe872
   "Apply compulsory unfoldings during desugaring, except for `seq` which is special."
which turned out to be a rather messy hack in DsBinds

5 years agoComments only
Simon Peyton Jones [Thu, 20 Nov 2014 17:16:30 +0000 (17:16 +0000)] 
Comments only

5 years agoRewrite Note [Deriving any class]
Joachim Breitner [Fri, 21 Nov 2014 10:07:40 +0000 (11:07 +0100)] 
Rewrite Note [Deriving any class]

Phrases like “Currently, you can...” are going to sound strange in a few
years; I rephrased the note to sound less like a proposal and more like
an explanation.

5 years agoRevert change to alias handling in ppLlvmGlobal introduced in d87fa34, which requires...
Luke Iannini [Fri, 21 Nov 2014 05:10:57 +0000 (21:10 -0800)] 
Revert change to alias handling in ppLlvmGlobal introduced in d87fa34, which requires LLVM 3.6.

Signed-off-by: Austin Seipp <>
5 years agoUnbreak build (fallout from 067f1e4f20e)
Austin Seipp [Fri, 21 Nov 2014 06:23:40 +0000 (00:23 -0600)] 
Unbreak build (fallout from 067f1e4f20e)

Signed-off-by: Austin Seipp <>
5 years agoImplement #5462 (deriving clause for arbitrary classes)
Jose Pedro Magalhaes [Fri, 21 Nov 2014 04:41:28 +0000 (22:41 -0600)] 
Implement #5462 (deriving clause for arbitrary classes)

Summary: (this has been submitted on behalf on @dreixel)

Reviewers: simonpj, hvr, austin

Reviewed By: simonpj, austin

Subscribers: goldfire, thomie, carter, dreixel

Differential Revision:

GHC Trac Issues: #5462

5 years agoAdd flag `-fwarn-missing-exported-sigs`
Eric Seidel [Fri, 21 Nov 2014 04:39:32 +0000 (22:39 -0600)] 
Add flag `-fwarn-missing-exported-sigs`

Summary: add `-fwarn-missing-exported-sigs` to only warn about missing signatures if the name is exported

Test Plan: validate, see testsuite/tests/warnings/should_compile/T2526.hs

Reviewers: ezyang, austin, thomie

Reviewed By: austin, thomie

Subscribers: ezyang, thomie, carter

Differential Revision:

GHC Trac Issues: #2526


5 years agoExport scanl' from Data.OldList and Data.List
David Feuer [Fri, 21 Nov 2014 04:38:57 +0000 (22:38 -0600)] 
Export scanl' from Data.OldList and Data.List

Summary: Fixes #9368

Reviewers: nomeata, hvr, ekmett, austin

Reviewed By: ekmett, austin

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9368

5 years agoHide `Data.OldList` module
Herbert Valerio Riedel [Fri, 21 Nov 2014 04:21:06 +0000 (22:21 -0600)] 
Hide `Data.OldList` module

The `Data.OldList` module was originally created in
3daf0023d2dcf7caf85d61f2dc177f8e9421b2fd to provide a way to access the
original list-specialised functions from `Data.List`. It was also made
an exposed module in order to facilitate adapting the
`haskell2010`/`haskell98` packages. However, since the
`haskell2010`/`haskell98` packages were dropped, we no longer need to
expose `Data.OldList`.

Depends on D511

Reviewers: ekmett, austin

Reviewed By: ekmett, austin

Subscribers: thomie, carter

Differential Revision:

5 years agoDelete old-{time,locale} and haskell{98,2010}
Austin Seipp [Thu, 20 Nov 2014 19:30:56 +0000 (13:30 -0600)] 
Delete old-{time,locale} and haskell{98,2010}

Depends on D510. This is the final blow and removes them from
the tree completely.

Signed-off-by: Austin Seipp <>
Test Plan: I looked really hard but didn't see them.

Reviewers: hvr, ekmett

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9590

5 years agoDon't build old-{time,locale} and haskell{98,2010}
Austin Seipp [Fri, 21 Nov 2014 03:29:04 +0000 (21:29 -0600)] 
Don't build old-{time,locale} and haskell{98,2010}

As discussed on and the trac ticket, we're removing
these packages from the 7.10 release as they no longer work correctly,
and can't easily be made to properly follow the standard as `base`
changes over time.

This does not remove the packages from the tree, only the build system.

Signed-off-by: Austin Seipp <>
Test Plan: iiam

Reviewers: hvr, ekmett

Reviewed By: hvr, ekmett

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9590

5 years agoTest #9109 in typecheck/should_fail/T9109
Richard Eisenberg [Tue, 18 Nov 2014 20:19:20 +0000 (15:19 -0500)] 
Test #9109 in typecheck/should_fail/T9109

5 years agoUpdate manual to get rid of bogus `coerce` example (#9788)
Richard Eisenberg [Tue, 18 Nov 2014 19:22:30 +0000 (14:22 -0500)] 
Update manual to get rid of bogus `coerce` example (#9788)

5 years agoTest #9201 in typecheck/should_fail/T9201
Richard Eisenberg [Tue, 18 Nov 2014 18:19:42 +0000 (13:19 -0500)] 
Test #9201 in typecheck/should_fail/T9201

5 years agoTest #9318 in typecheck/should_fail/T9318
Richard Eisenberg [Tue, 18 Nov 2014 18:16:01 +0000 (13:16 -0500)] 
Test #9318 in typecheck/should_fail/T9318

5 years agoAdd release notes for #8100, #9527, and #9064.
Richard Eisenberg [Wed, 12 Nov 2014 20:13:34 +0000 (15:13 -0500)] 
Add release notes for #8100, #9527, and #9064.

5 years agoTest #9151 in typecheck/should_compile/T9151.
Richard Eisenberg [Wed, 12 Nov 2014 19:48:25 +0000 (14:48 -0500)] 
Test #9151 in typecheck/should_compile/T9151.

This test case should pass right now -- the bug is fixed,
presumably by #9200.

5 years agoFix #9220 by adding role annotations.
Richard Eisenberg [Fri, 7 Nov 2014 22:34:59 +0000 (17:34 -0500)] 
Fix #9220 by adding role annotations.

This includes a submodule update for `array`.
There is also an added test in libraries/array/tests/T9220.

5 years agoFix #9209, by reporting an error instead of panicking on bad splices.
Richard Eisenberg [Mon, 3 Nov 2014 18:49:59 +0000 (13:49 -0500)] 
Fix #9209, by reporting an error instead of panicking on bad splices.

5 years agoTest #9209 in th/T9209
Richard Eisenberg [Mon, 3 Nov 2014 18:46:58 +0000 (13:46 -0500)] 
Test #9209 in th/T9209

5 years agoKill trailing whitespace
Jan Stolarek [Thu, 20 Nov 2014 16:41:10 +0000 (17:41 +0100)] 
Kill trailing whitespace

5 years agoSplit SynTyCon to SynonymTyCon and FamilyTyCon
Jan Stolarek [Wed, 19 Nov 2014 21:03:05 +0000 (22:03 +0100)] 
Split SynTyCon to SynonymTyCon and FamilyTyCon

This patch refactors internal representation of type synonyms and type families by splitting them into two separate data constructors of TyCon data type. The main motivation is is that some fields make sense only for type synonyms and some make sense only for type families. This will be even more true with the upcoming injective type families.

There is also some refactoring of names to keep the naming constistent. And thus tc_kind field has become tyConKind and tc_roles has become tcRoles. Both changes are not visible from the outside of TyCon module.

Updates haddock submodule

Reviewers: simonpj

Differential Revision:

GHC Trac Issues: #9812

5 years agoImplement typechecker plugins
Adam Gundry [Thu, 20 Nov 2014 13:32:26 +0000 (13:32 +0000)] 
Implement typechecker plugins


This is based on work by Iavor Diatchki and Eric Seidel.

Test Plan: validate

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: gridaphobe, yav, thomie, carter

Differential Revision:


5 years agoAdd support for pattern synonym type signatures.
Dr. ERDI Gergo [Thu, 20 Nov 2014 14:38:11 +0000 (22:38 +0800)] 
Add support for pattern synonym type signatures.
Syntax is of the form

    pattern P :: (Prov b) => (Req a) => a -> b -> Int -> T a

which declares a pattern synonym called `P`, with argument types `a`, `b`,
and `Int`, and result type `T a`, with provided context `(Prov b)` and required
context `(Req a)`.

The Haddock submodule is also updated to use this new syntax in generated docs.

5 years agoUpdate shift/reduce conflict number in parser
Dr. ERDI Gergo [Thu, 20 Nov 2014 10:21:30 +0000 (18:21 +0800)] 
Update shift/reduce conflict number in parser

5 years agoMake Data.Functor.Identity trustworthy again
Herbert Valerio Riedel [Thu, 20 Nov 2014 08:53:46 +0000 (09:53 +0100)] 
Make Data.Functor.Identity trustworthy again

Alas `{-# LANGUAGE Safe #-}` can't be used since `Data.Coerce` isn't "safe".
However, we use `coerce` just as an optimisation
(see also 4ba884bdd3a9521ea92fcda8f601a7d0f3537bc1 which broke the
safe-inferred status of `Data.Functor.Identity`), so this module at least
deserves `{-# LANGUAGE Trustworthy #-}`.

NOTE: `Data.Functor.Identity` was added to `base` in the context of #9664

Reviewed By: luite

Differential Revision:

5 years agoMake calling conventions in template haskell Syntax.hs consistent with those in ghc...
Luite Stegeman [Thu, 20 Nov 2014 00:38:58 +0000 (18:38 -0600)] 
Make calling conventions in template haskell Syntax.hs consistent with those in ghc ForeignCall.hs
this impliments #9703 from ghc trac

Test Plan: still needs tests

Reviewers: cmsaperstein, ekmett, goldfire, austin

Reviewed By: goldfire, austin

Subscribers: goldfire, thomie, carter, simonmar

Differential Revision:

GHC Trac Issues: #9703

5 years agoghc generates more user-friendly error messages
Mike Izbicki [Thu, 20 Nov 2014 00:29:37 +0000 (18:29 -0600)] 
ghc generates more user-friendly error messages

Test Plan: Compiled ghc fine.  Opened ghci and fed it invalid code.  It gave the improved error messages in response.

Reviewers: austin

Subscribers: thomie, simonpj, spacekitteh, rwbarton, simonmar, carter

Differential Revision:

5 years agoarm64: 64bit iOS and SMP support (#7942)
Luke Iannini [Wed, 19 Nov 2014 23:23:35 +0000 (17:23 -0600)] 
arm64: 64bit iOS and SMP support (#7942)

Signed-off-by: Austin Seipp <>
5 years agocompiler/main: fixes #9776
Carlos Tomé [Wed, 19 Nov 2014 23:07:53 +0000 (17:07 -0600)] 
compiler/main: fixes #9776

Test Plan: test T9776 under tests/driver

Reviewers: jstolarek, austin

Reviewed By: jstolarek, austin

Subscribers: jstolarek, thomie, carter

Differential Revision:

GHC Trac Issues: #9776

5 years agouse correct word size for shiftRightLogical and removeOp32
Luite Stegeman [Wed, 19 Nov 2014 23:00:49 +0000 (17:00 -0600)] 
use correct word size for shiftRightLogical and removeOp32

shiftRightLogical used a host sized Word for the intermediate value,
which would produce the wrong result when cross compiling to a target
with a different word size than the host.

removeOp32 used the preprocessor to bake in word size assumptions,
rather than getting the target word size from DynFlags

Test Plan: validate

Reviewers: hvr, rwbarton, carter, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9736

5 years agomake TcRnMonad.lhs respect -ddump-to-file
Greg Weber [Wed, 19 Nov 2014 22:43:26 +0000 (16:43 -0600)] 
make TcRnMonad.lhs respect -ddump-to-file

Summary: allows things such as: -ddump-to-file -ddump-splices

Test Plan:
compile with flags -ddump-to-file -ddump-splices
verify that it does output an extra file

Try out other flags.
I noticed that with -ddump-tc there is some output going to file and some to stdout.

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: simonpj, thomie, carter

Differential Revision:

GHC Trac Issues: #9126

5 years agoAllow -dead_strip linking on platforms with .subsections_via_symbols
Moritz Angermann [Wed, 19 Nov 2014 22:38:22 +0000 (16:38 -0600)] 
Allow -dead_strip linking on platforms with .subsections_via_symbols

This allows to link objects produced with the llvm code generator to be linked with -dead_strip. This applies to at least the iOS cross compiler and OS X compiler.

Signed-off-by: Moritz Angermann <>
Test Plan: Create a ffi library and link it with -dead_strip. If the resulting binary does not crash, the patch works as advertised.

Reviewers: rwbarton, simonmar, hvr, dterei, mzero, ezyang, austin

Reviewed By: dterei, ezyang, austin

Subscribers: thomie, mzero, simonmar, ezyang, carter

Differential Revision:

5 years agoOnly test for bug #9439 when llvm is installed
Thomas Miedema [Wed, 19 Nov 2014 04:23:27 +0000 (22:23 -0600)] 
Only test for bug #9439 when llvm is installed

Reviewers: bgamari, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9807

5 years agoadd missing instances for Loc and a few missing Eq instances
Luite Stegeman [Wed, 19 Nov 2014 04:21:44 +0000 (22:21 -0600)] 
add missing instances for Loc and a few missing Eq instances

Summary: This adds a few missing instances that can be automatically derived

Reviewers: hvr, goldfire, austin

Reviewed By: goldfire, austin

Subscribers: thomie, carter

Differential Revision:

5 years agotemplate-haskell: Missing instances for Rational and ().
Mathieu Boespflug [Wed, 19 Nov 2014 04:21:15 +0000 (22:21 -0600)] 
template-haskell: Missing instances for Rational and ().

Test Plan: ./validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoFilter input to abiHash early
Mateusz Kowalczyk [Wed, 19 Nov 2014 04:21:03 +0000 (22:21 -0600)] 
Filter input to abiHash early

This is already done near the only call site so why not. It is ugly to
see it at 'abiHash' itself.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoAdd remaining <unknown>s and comments to .mailmap
Thomas Miedema [Wed, 19 Nov 2014 04:20:14 +0000 (22:20 -0600)] 
Add remaining <unknown>s and comments to .mailmap

All done, except for these 2 empty commits:

$ git log --author=unknown --use-mailmap --oneline
7e5c2b2 [project @ 2001-12-06 10:17:35 by mbs] Established under cvs.
6456598 [project @ 2000-12-01 10:33:41 by cryder] Initial revision

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoTurn CoreWriter into a newtype; fix comment
David Feuer [Wed, 19 Nov 2014 04:19:46 +0000 (22:19 -0600)] 
Turn CoreWriter into a newtype; fix comment

Turn CoreWriter into a newtype. A comment claimed something is forced
before returning, but it's actually not. Change comment to match

Reviewers: xich, simonpj, ezyang, austin

Reviewed By: ezyang, austin

Subscribers: thomie, carter

Differential Revision:

5 years agoImplement new Foldable methods for HsPatSynDetails
David Feuer [Wed, 19 Nov 2014 04:18:57 +0000 (22:18 -0600)] 
Implement new Foldable methods for HsPatSynDetails

Summary: Also explicitly define foldl1 and foldr1, which should generally work better with list-specific versions.

Reviewers: austin

Reviewed By: austin

Subscribers: rwbarton, thomie, carter

Differential Revision:

5 years agoUpdate documentation for "Batch compiler mode"
Thomas Miedema [Wed, 19 Nov 2014 04:18:43 +0000 (22:18 -0600)] 
Update documentation for "Batch compiler mode"

Since commit 7828bf3ea2ea34e7a3a8662f5f621ef706ffee5c
* --make is the default
* -c is a mode flag, except when used in combination with --make

* -C (generate C code) is only available in unregisterised mode.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoRefactor: use System.FilePath.splitSearchPath
Thomas Miedema [Wed, 19 Nov 2014 04:17:47 +0000 (22:17 -0600)] 
Refactor: use System.FilePath.splitSearchPath

To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with
ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5de). This
solution however caused issue #9698 ("GHC_PACKAGE_PATH should be more lenient
for empty paths").

This patch reverts back to System.FilePath.splitSearchPath (fixes #9698) and
adresses (#2521) by testing for a trailing search path separators explicitly
(instead of implicitly using empty search path elements).

Empty paths are now allowed (ignored on Windows, interpreted as current
directory on Posix systems), and trailing path separator still tack on the
user and system package databases.

Also update submodule filepath, which has a version of splitSearchPath which
handles quotes in the same way as our custom version did.

Test Plan:
$ GHC_PACKAGE_PATH=/::/home: ./ghc-pkg list
db stack: ["/",".","/home","<userdb>","<systemdb>"]

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, simonmar

Differential Revision:

GHC Trac Issues: #2521, #9698

5 years agoThe test runner now also works under the msys-native Python.
Gintautas Miliauskas [Mon, 22 Sep 2014 21:10:56 +0000 (23:10 +0200)] 
The test runner now also works under the msys-native Python.

Msys binaries apply heuristics to escape paths in arguments intended for
non-msys binaries, which breaks timeout invocations, see #9626.

Signed-off-by: Austin Seipp <>
5 years agorts: remove old-style field designator extension (#9396)
Austin Seipp [Wed, 19 Nov 2014 03:21:47 +0000 (21:21 -0600)] 
rts: remove old-style field designator extension (#9396)

Authored-by: jrp
Signed-off-by: Austin Seipp <>
5 years agoOptimise `Identity` instances with `coerce`
Herbert Valerio Riedel [Wed, 19 Nov 2014 10:44:37 +0000 (11:44 +0100)] 
Optimise `Identity` instances with `coerce`

This also overrides all optional `Foldable` methods
(which would otherwise be default-implemented in terms of `foldMap`)
with supposedly optimally minimal implementations.

While at it, this also removes the redundant `{-# LANGUAGE CPP #-}`.

Reviewed By: austin, dfeuer

Differential Revision:

5 years agoRestore exact old semantics of `decodeFloat`
Herbert Valerio Riedel [Wed, 19 Nov 2014 10:09:33 +0000 (11:09 +0100)] 
Restore exact old semantics of `decodeFloat`

`integer-gmp2` uses the new 64bit-based IEEE deconstructing primop
introduced in b62bd5ecf3be421778e4835010b6b334e95c5a56.

However, the returned values differ for exceptional IEEE values:

Previous (expected) semantics:

  > decodeFloat (-1/0)

  > decodeFloat (1/0)

  > decodeFloat (0/0)

Currently (broken) semantics:

  > decodeFloat (-1/0 :: Double)

  > decodeFloat (1/0 :: Double)

  > decodeFloat (0/0 :: Double)

This patch reverts to the old expected semantics.

I plan to revisit the implementation during GHC 7.11 development.

This should address #9810

Reviewed By: austin, ekmett, luite

Differential Revision:

5 years agoReimplement im/export primitives for integer-gmp2
Herbert Valerio Riedel [Tue, 18 Nov 2014 15:52:02 +0000 (16:52 +0100)] 
Reimplement im/export primitives for integer-gmp2

The import/export operations were available in `integer-gmp-0.5.1`
already, but need to be reimplemented from scratch for the
`integer-gmp-1.0.0` rewrite.

This also adds a few more operations than were previously available for
use w/ the `BigNat` type (which will be useful for implementing
serialisation for the upcoming `Natural` type)

Specifically, the following operations are (re)added (albeit with
slightly different type-signatures):

 - `sizeInBaseBigNat`
 - `sizeInBaseInteger`
 - `sizeInBaseWord#`

 - `exportBigNatToAddr`
 - `exportIntegerToAddr`
 - `exportWordToAddr`
 - `exportBigNatToMutableByteArray`
 - `exportIntegerToMutableByteArray`
 - `exportWordToMutableByteArray`

 - `importBigNatFromAddr`
 - `importIntegerFromAddr`
 - `importBigNatFromByteArray`
 - `importIntegerFromByteArray`

NOTE: The `integerGmpInternals` test-case is updated but not yet
      re-enabled as it contains tests for other primitives which aren't
      yet reimplemented.

This addresses #9281

Reviewed By: austin, duncan

Differential Revision:

5 years agoSupport for "with" renaming syntax, and output a feature flag.
Edward Z. Yang [Mon, 11 Aug 2014 17:40:13 +0000 (18:40 +0100)] 
Support for "with" renaming syntax, and output a feature flag.

- Feature flag indicates to Cabal that we support thinning and renaming as
  it needs.

- Support -package "base with (Foo as Bar)" which brings the ordinary
  modules into scope, as well as adding the renamings to scope.

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

Reviewers: simonpj, austin

Subscribers: thomie, carter

Differential Revision:

5 years agoWhen outputting list of available instances, sort it.
Edward Z. Yang [Tue, 11 Nov 2014 00:25:58 +0000 (16:25 -0800)] 
When outputting list of available instances, sort it.

The intent of this commit is to make test suite cases more stable, so that
it doesn't matter what order we load interface files in, the test output
doesn't change.

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

Reviewers: simonpj, austin

Subscribers: thomie, carter

Differential Revision:

5 years agoComments only
Simon Peyton Jones [Tue, 18 Nov 2014 22:27:01 +0000 (22:27 +0000)] 
Comments only

5 years agoRevert "base: Fix (**) instance for Data.Complex (#8539)"
Austin Seipp [Tue, 18 Nov 2014 19:12:12 +0000 (13:12 -0600)] 
Revert "base: Fix (**) instance for Data.Complex (#8539)"

This broke validate due to name shadowing warnings.

This reverts commit 1f6b1ab4b6d7203481bfaf374b014972f7756fb2.

5 years agoFix detection of GNU gold linker if invoked via gcc with parameters
Sebastian Dröge [Tue, 18 Nov 2014 18:40:20 +0000 (12:40 -0600)] 
Fix detection of GNU gold linker if invoked via gcc with parameters

Previously the linker was called without any commandline parameters to
detect whether bfd or gold is used. However the -fuse-ld parameter can
be used to switch between gold and bfd and should be taken into account

Trac #9336

Signed-off-by: Austin Seipp <>
5 years agoDisable AVX for LLVM 3.2 by default (#9391)
Peter Wortmann [Tue, 18 Nov 2014 18:33:05 +0000 (12:33 -0600)] 
Disable AVX for LLVM 3.2 by default (#9391)

Due to a bug LLVM generates a C-like frame pointer prelude for functions
that use AVX instructions. This causes programs using the GHC calling
convention to crash, therefore we simply disable them. People that want
to use AVX should consider upgrading to a more current LLVM version.

Signed-off-by: Austin Seipp <>
5 years agomapMaybe: Typo in the comment (#9644)
Wieland Hoffmann [Sun, 28 Sep 2014 17:22:37 +0000 (19:22 +0200)] 
mapMaybe: Typo in the comment (#9644)

Signed-off-by: Austin Seipp <>
5 years agoFix usage of `find -perm` in aclocal.m4 (#9697)
Nicholas Hart [Tue, 18 Nov 2014 18:21:03 +0000 (12:21 -0600)] 
Fix usage of `find -perm` in aclocal.m4 (#9697)

Signed-off-by: Austin Seipp <>
5 years agoUpdate comment about C helper for foreign exports (#9713)
Bertram Felgenhauer [Tue, 18 Nov 2014 18:15:33 +0000 (12:15 -0600)] 
Update comment about C helper for foreign exports (#9713)

Signed-off-by: Austin Seipp <>
5 years agobase: Fix (**) instance for Data.Complex (#8539)
Austin Seipp [Tue, 18 Nov 2014 18:10:34 +0000 (12:10 -0600)] 
base: Fix (**) instance for Data.Complex (#8539)

Reviewed-by: Edward Kmett <>
Authored-by: Yalas, Scott Turner
Signed-off-by: Austin Seipp <>
5 years agoAdd missing semicolon in Schedule.c
Simon Peyton Jones [Tue, 18 Nov 2014 17:07:41 +0000 (17:07 +0000)] 
Add missing semicolon in Schedule.c

I think this went wrong in 2a6f193b

5 years agoOutputable instance for IfaceVectInfo
Mateusz Kowalczyk [Tue, 18 Nov 2014 16:58:56 +0000 (16:58 +0000)] 
Outputable instance for IfaceVectInfo

5 years agoWhitespace only
Mateusz Kowalczyk [Tue, 18 Nov 2014 16:58:45 +0000 (16:58 +0000)] 
Whitespace only

5 years agoFix ffi023
Simon Marlow [Tue, 18 Nov 2014 15:40:45 +0000 (15:40 +0000)] 
Fix ffi023

5 years agoBuild xhtml and haddock only when `HADDOCK_DOCS=YES`
Joachim Breitner [Tue, 18 Nov 2014 09:44:23 +0000 (10:44 +0100)] 
Build xhtml and haddock only when `HADDOCK_DOCS=YES`

This fixes #8558

5 years agoAdd a note why tcGetInstEnvs is duplicated.
Edward Z. Yang [Thu, 6 Nov 2014 04:57:03 +0000 (20:57 -0800)] 
Add a note why tcGetInstEnvs is duplicated.

Signed-off-by: Edward Z. Yang <>
5 years agoRemove optimized package lookup, simplifying code.
Edward Z. Yang [Sat, 15 Nov 2014 09:43:42 +0000 (01:43 -0800)] 
Remove optimized package lookup, simplifying code.

A while back when I was refactoring the package code, I tried to solve
a performance problem by introducing a fastpath for module lookups.  Well,
it turned out the performance problem was unrelated, but I kept the optimization
because it seemed vaguely useful.

In this commit, I remove the optimization because I don't really think it's
buying us much and it increased code complexity.

ToDo: Inline mkModuleToPkgConfGeneric into mkModuleToPkgConfAll

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

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoChange a comment referring falsely to seq
David Feuer [Tue, 18 Nov 2014 01:19:18 +0000 (19:19 -0600)] 
Change a comment referring falsely to seq

Summary: Instead, describe what it actually does.

Reviewers: austin, ekmett, simonpj, hvr

Reviewed By: austin, ekmett

Subscribers: simonpj, thomie, carter

Projects: #ghc

Differential Revision:

5 years agoAdding dedicated Show instances for SrcSpan/SrcLoc
Alan Zimmerman [Tue, 18 Nov 2014 01:19:10 +0000 (19:19 -0600)] 
Adding dedicated Show instances for SrcSpan/SrcLoc

The derived Show instances for SrcSpan and SrcLoc are very verbose.

This patch replaces them with hand-made ones which use positional
syntax for the record constructors, rather than exhaustively listing
each one.

Test Plan: sh ./validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoDocs only
Edward Z. Yang [Tue, 18 Nov 2014 01:19:00 +0000 (19:19 -0600)] 
Docs only

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

Test Plan: n/a

Reviewers: austin, Mikolaj

Reviewed By: austin, Mikolaj

Subscribers: thomie, carter

Differential Revision:

5 years agoMake listArray fuse
David Feuer [Tue, 18 Nov 2014 01:16:16 +0000 (19:16 -0600)] 
Make listArray fuse

Summary: Make listArray fuse with a list producer. Note: if code size increases too much, we can fix that with some `RULES`.

Reviewers: nomeata, hvr, austin, ekmett, simonmar, bgamari

Reviewed By: bgamari

Subscribers: bgamari, thomie, carter

Differential Revision:

GHC Trac Issues: #9801

5 years agoRemove outdated TODO in TimeManager
Yuras Shumovich [Tue, 18 Nov 2014 01:16:08 +0000 (19:16 -0600)] 
Remove outdated TODO in TimeManager

It describes a work around Trac #3838, but it is already fixed and the
workaround removed, Trac #7653

Test Plan: not needed

Reviewers: hvr, Mikolaj, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

5 years agoDon't use absolute paths for perl in validate
Mateusz Kowalczyk [Tue, 18 Nov 2014 01:15:59 +0000 (19:15 -0600)] 
Don't use absolute paths for perl in validate

Summary: This will *not* work on NixOS for example.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9057

5 years agodocument addDependentFile uses contents, not mtime
Greg Weber [Tue, 18 Nov 2014 01:15:51 +0000 (19:15 -0600)] 
document addDependentFile uses contents, not mtime

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #4900

5 years agoFix a bug introduced with allocation counters
Simon Marlow [Mon, 17 Nov 2014 13:03:56 +0000 (13:03 +0000)] 
Fix a bug introduced with allocation counters

5 years agoUpdate validate settings now that containers and process have been
David Terei [Mon, 17 Nov 2014 02:29:58 +0000 (18:29 -0800)] 
Update validate settings now that containers and process have been
updated to handle `-fwarn-trustworthy-safe`.

5 years agoFix compilation of `integer-gmp2` with `-O0`
Herbert Valerio Riedel [Sat, 15 Nov 2014 17:05:58 +0000 (18:05 +0100)] 
Fix compilation of `integer-gmp2` with `-O0`

At optimization level `-O0` `wordToInteger` wasn't inlined, and this caused a
`__integer` literal to turn up in final Core, which would trigger the GHC panic

  ghc-stage1: panic! (the 'impossible' happened)
    (GHC version 7.9.20141114 for x86_64-unknown-linux):
Can't use Integer in integer-*

By forcing inlining via `inline` this is avoided.
This should hopefully address #9800.

5 years agoUpdate to (unreleased) `deepseq-`
Herbert Valerio Riedel [Sat, 15 Nov 2014 11:16:38 +0000 (12:16 +0100)] 
Update to (unreleased) `deepseq-`

This pulls in the new `Generic`-based `-XDefaultSignature`-based default
implementation for `rnf`[1], and will be interesting to use in combination
with the soon to be merged `-XDeriveAnyClass` extension.

This requires updating several other submodules as well in order
to relax the upper bound on `deepseq` and/or in a few cases to
avoid relying on the default method implementation of `rnf`:

 - `Cabal`
 - `bytestring`
 - `containers`
 - `parallel`
 - `process`
 - `time`


5 years agoWorkaround 452d6aa95b7 breaking TrustworthySafe03
Herbert Valerio Riedel [Sat, 15 Nov 2014 10:18:12 +0000 (11:18 +0100)] 
Workaround 452d6aa95b7 breaking TrustworthySafe03

This is only a temporary kludge until the issue workarounded by 452d6aa95b7
gets properly fixed

5 years agoGeneralize exposed-modules field in installed package database
Edward Z. Yang [Sat, 15 Nov 2014 08:08:53 +0000 (00:08 -0800)] 
Generalize exposed-modules field in installed package database

Instead of recording exposed-modules and reexported-modules as seperate
fields in the installed package database, this commit merges them into
a single field (exposed-modules).  The motivation for this change is
in preparation for the inclusion of *signatures* into the installed
package database, which may also be reexported.  Merging the representation
means that we can treat reexports uniformly, no matter if they're a normal
module or a signature.

This commit adds a stub for signatures, but that code isn't wired up to
anything yet.

Contains Cabal submodule update to accommodate these changes.

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

Reviewers: simonpj, duncan, austin

Subscribers: thomie, carter, simonmar

Differential Revision:

5 years agoPartially revert 475dd93efa
Austin Seipp [Fri, 14 Nov 2014 17:51:31 +0000 (11:51 -0600)] 
Partially revert 475dd93efa

This introduces ./validate failures for Windows right now, so in the
mean time let's just back this flag out as a default -Wall flag.

Signed-off-by: Austin Seipp <>
5 years agoUpdate .mailmap
Thomas Miedema [Sat, 8 Nov 2014 12:44:57 +0000 (13:44 +0100)] 
Update .mailmap

[skip ci]

5 years agoImplement amap/coerce for Array (re #9796)
David Feuer [Thu, 13 Nov 2014 20:12:05 +0000 (21:12 +0100)] 
Implement amap/coerce for Array (re #9796)

Implement an `amap`/`coerce` rule in `GHC.Arr` to match the
`map`/`coerce` rule in GHC.Base.

In order to do so, delay inlining `amap` until phase 1.

To prevent the inlining delay from causing major inefficiencies due to
missed list fusion, rewrite `amap` to avoid relying on list fusion. This
has the extra benefit of reducing the size of the compiled amap code by
skipping the impossible case of an array with a negative size.

Reviewed By: nomeata

Differential Revision:

5 years agoWhen calling the success continuation of a matcher, pass existential tyvars
Dr. ERDI Gergo [Thu, 13 Nov 2014 09:47:18 +0000 (17:47 +0800)] 
When calling the success continuation of a matcher, pass existential tyvars
as type arguments, not value arguments

5 years agonlHsTyApps: for applying a function both on type- and term-level arguments
Dr. ERDI Gergo [Fri, 7 Nov 2014 14:49:52 +0000 (22:49 +0800)] 
nlHsTyApps: for applying a function both on type- and term-level arguments

5 years agoApply compulsory unfoldings during desugaring, except for `seq` which is special.
Dr. ERDI Gergo [Wed, 12 Nov 2014 10:18:09 +0000 (18:18 +0800)] 
Apply compulsory unfoldings during desugaring, except for `seq` which is special.
See Note [Unfolding while desugaring] for the rationale.

5 years agoIf pattern synonym is bidirectional and its type is some unboxed type T#,
Dr. ERDI Gergo [Sat, 8 Nov 2014 10:38:12 +0000 (18:38 +0800)] 
If pattern synonym is bidirectional and its type is some unboxed type T#,
generate a worker function of type Void# -> T#, and redirect the wrapper
(via a compulsory unfolding) to the worker. Fixes #9732.

5 years agoBinding things matched by an unboxed pattern synonym should require a bang
Dr. ERDI Gergo [Sat, 8 Nov 2014 08:59:47 +0000 (16:59 +0800)] 
Binding things matched by an unboxed pattern synonym should require a bang

5 years agoFix typo in panic message
Dr. ERDI Gergo [Thu, 6 Nov 2014 11:38:40 +0000 (19:38 +0800)] 
Fix typo in panic message

5 years agoFix `integer-gmp2` compilation with GMP 4.x (#9281)
Herbert Valerio Riedel [Thu, 13 Nov 2014 09:49:43 +0000 (10:49 +0100)] 
Fix `integer-gmp2` compilation with GMP 4.x (#9281)

GMP 4.x didn't provide the `mp_bitcnt_t` typedef yet, so we locally
define one if GMP 4.x is detected.

5 years agoImprove `Foldable` instance for `Array`
David Feuer [Thu, 13 Nov 2014 08:10:57 +0000 (09:10 +0100)] 
Improve `Foldable` instance for `Array`

Previously, `Array`s were simply converted to lists, and the list
methods used. That works acceptably well for `foldr` and `foldr1`, but
not so sensibly for most other things. Left folds ended up "twisted" the
way they are for lists, leading to surprising performance

Moreover, this implements `length` and `null` so they check the array
size directly.

Finally, a test is added to the testsuite ensuring the overridden
`Foldable` methods agree with their expected default semantics.

Addresses #9763

Reviewed By: hvr, austin

Differential Revision:

5 years agobase: define `sequence = mapM id`
David Feuer [Thu, 13 Nov 2014 08:05:22 +0000 (09:05 +0100)] 
base: define `sequence = mapM id`

This avoids duplication in `GHC.Base`; originally, we had

  mapM f = sequence . map f

This led to excessive allocation in `cryptarithm2`. Defining

  sequence = mapM id

does not appear to cause any `nofib` problems.

Reviewed By: hvr

Differential Revision:

5 years agoMake unwords and words fuse somewhat
David Feuer [Thu, 13 Nov 2014 07:59:14 +0000 (08:59 +0100)] 
Make unwords and words fuse somewhat

Make `words` a good producer and `unwords` a good consumer for list
fusion. Thus `unwords . words` will avoid producing an intermediate list
of words, although it will produce each individual word.

Make `unwords` slightly lazier, so that
`unwords (s : undefined) = s ++ undefined` instead of `= undefined`.

Reviewed By: austin

Differential Revision:

5 years agobase: Fix map/coerce comment
David Feuer [Thu, 13 Nov 2014 07:43:33 +0000 (08:43 +0100)] 
base: Fix map/coerce comment

Make the comment on the map/coerce rule refer to the right section in
the paper; give the full name of the papers, and name its authors.

[skip ci]

Differential Revision:

5 years agoUpdate userguide for new `-fwarn-trustworthy-safe` flag.
David Terei [Thu, 13 Nov 2014 02:39:01 +0000 (18:39 -0800)] 
Update userguide for new `-fwarn-trustworthy-safe` flag.

5 years agoAdd `--fwarn-trustworthy-safe` to `-Wall`
David Terei [Thu, 13 Nov 2014 00:11:39 +0000 (16:11 -0800)] 
Add `--fwarn-trustworthy-safe` to `-Wall`

Update submodule haskell2010, haskell98, hoop, hpc and stm to fix new

5 years agoAdd in `-fwarn-trustworthy-safe` flag.
David Terei [Fri, 7 Nov 2014 22:11:19 +0000 (14:11 -0800)] 
Add in `-fwarn-trustworthy-safe` flag.

This warns when a module marked as `-XTrustworthy` could have been
inferred as safe instead.

5 years agoRemove a stray Trustworthy flag in ghc.
David Terei [Wed, 12 Nov 2014 21:54:55 +0000 (13:54 -0800)] 
Remove a stray Trustworthy flag in ghc.

5 years agoincludes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20
Sergei Trofimovich [Wed, 12 Nov 2014 23:18:38 +0000 (23:18 +0000)] 
includes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20

_BSD_SOURCE we are using for 'gamma()' and friends
was deprecated in glibc-2.20 in favour of '_DEFAULT_SOURCE'.

gcc says:

    In file included from /usr/include/math.h:26:0:
                         from includes/Stg.h:69,
                         from /tmp/ghc19488_0/ghc19488_2.hc:3:

         warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
         # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

Patch fixes testsuite failures on UNREG
(stderr are not cluttered by warnings anymore).

Signed-off-by: Sergei Trofimovich <>
5 years agoFix #9404 by removing tcInfExpr.
Richard Eisenberg [Tue, 11 Nov 2014 02:27:58 +0000 (21:27 -0500)] 
Fix #9404 by removing tcInfExpr.

See the ticket for more info about the new algorithm. This is a small
simplification, unifying the treatment of type checking in a few
similar situations.

5 years agoTestsuite wibble due to #9404
Richard Eisenberg [Tue, 11 Nov 2014 12:58:03 +0000 (07:58 -0500)] 
Testsuite wibble due to #9404

[skip ci]

5 years agoTest #9404 (typecheck/should_compile/T9404 and T9404b)
Richard Eisenberg [Thu, 7 Aug 2014 13:20:41 +0000 (09:20 -0400)] 
Test #9404 (typecheck/should_compile/T9404 and T9404b)

5 years agoFix #9788 by giving `coerce` the right type.
Richard Eisenberg [Tue, 11 Nov 2014 01:41:38 +0000 (20:41 -0500)] 
Fix #9788 by giving `coerce` the right type.

No test case added, as the original mistake is just one level
up from a typo.