ghc.git
3 years agoFix grouping for pattern synonyms
Simon Peyton Jones [Tue, 22 Dec 2015 13:33:23 +0000 (14:33 +0100)] 
Fix grouping for pattern synonyms

When grouping pattern synonyms in the desugarer, to find when a single
match will work for the whole group, we use `Match.sameGroup`.  But this
function was declaring two pattern-synonym matches equal to often.
Result: Lint errors and broken semantics.

The fix is easy.  See Note [Pattern synonym groups].

Re-do typechecking for pattern synonym signatures

Test Plan: Validate

Reviewers: austin

Subscribers: thomie, mpickering, simonpj

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

3 years agoUpdate stm submodule to v2.4.4.1 release
Herbert Valerio Riedel [Tue, 22 Dec 2015 12:59:36 +0000 (13:59 +0100)] 
Update stm submodule to v2.4.4.1 release

This `stm` release also addresses #10967

3 years agoRework Template Haskell's handling of strictness
RyanGlScott [Tue, 22 Dec 2015 10:25:59 +0000 (11:25 +0100)] 
Rework Template Haskell's handling of strictness

Currently, Template Haskell's treatment of strictness is not enough to
cover all possible combinations of unpackedness and strictness. In
addition, it isn't equipped to deal with new features (such as
`-XStrictData`) which can change a datatype's fields' strictness during
compilation.

To address this, I replaced TH's `Strict` datatype with
`SourceUnpackedness` and `SourceStrictness` (which give the programmer a
more complete toolkit to configure a datatype field's strictness than
just `IsStrict`, `IsLazy`, and `Unpack`). I also added the ability to
reify a constructor fields' strictness post-compilation through the
`reifyConStrictness` function.

Fixes #10697.

Test Plan: ./validate

Reviewers: simonpj, goldfire, bgamari, austin

Reviewed By: goldfire, bgamari

Subscribers: thomie

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

GHC Trac Issues: #10697

3 years agoRetain AnnTilde in splitTildeApps
Alan Zimmerman [Tue, 22 Dec 2015 10:35:22 +0000 (12:35 +0200)] 
Retain AnnTilde in splitTildeApps

splitTildeApps can introduce a new HsAppInfix for a tilde, with a fresh
SrcSpan, disconnecting its existing AnnTilde API Annotation.

A tilde needs AnnTilde to render properly, this patch adds a new one on
the fresh SrcSpan

3 years agoComments only, about coercion holes
Simon Peyton Jones [Tue, 22 Dec 2015 10:03:14 +0000 (10:03 +0000)] 
Comments only, about coercion holes

Richard, pls take a look

3 years agoUpdate Cabal submodule to latest snapshot
Herbert Valerio Riedel [Tue, 22 Dec 2015 08:16:12 +0000 (09:16 +0100)] 
Update Cabal submodule to latest snapshot

The addition of several new Semigroup instances caused
a Haddock allocation increase.

3 years agoMake HsAppsType contents Located
Alan Zimmerman [Mon, 21 Dec 2015 20:30:45 +0000 (22:30 +0200)] 
Make HsAppsType contents Located

An HsAppInfix can carry a qconop/varop preceded by a SIMPLEQUOTE as a
Located RdrName.

In this case AnnSimpleQuote is attached to the Located HsAppType.

    | SIMPLEQUOTE qconop            {% ams (sLL $1 $> $ HsAppInfix $2)
                                           [mj AnnSimpleQuote $1] }
    | SIMPLEQUOTE varop             {% ams (sLL $1 $> $ HsAppInfix $2)
                                           [mj AnnSimpleQuote $1] }

This patch changes

    data HsType name
      ...
      | HsAppsTy [HsAppType name]

to

    data HsType name
      ...
      | HsAppsTy [LHsAppType name]

so that the annotation is not discarded when it reaches the ParsedSource

3 years agoFix GHCi segfault in Windows 32bit
Tamar Christina [Mon, 21 Dec 2015 20:02:46 +0000 (21:02 +0100)] 
Fix GHCi segfault in Windows 32bit

Summary:
Add missing calling convention to function pointer,
incorrect `cdecl` calling convention which should be `stdcall`
on x86 was causing the stack to be corrupted. When it tried to
return from the function the return pointer would be invalid.

Test Plan: ./validate

Reviewers: austin, erikd, bgamari, thomie

Reviewed By: bgamari, thomie

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

GHC Trac Issues: #11234

3 years agoUpdate hoopl submodule to final 3.10.2.1 release
Herbert Valerio Riedel [Mon, 21 Dec 2015 22:14:19 +0000 (23:14 +0100)] 
Update hoopl submodule to final 3.10.2.1 release

This is the designated release to go with GHC 8.0.1

/cc @mlite

3 years agousers_guide: Synchronize relnotes with base changelog
Ben Gamari [Mon, 21 Dec 2015 20:13:34 +0000 (21:13 +0100)] 
users_guide: Synchronize relnotes with base changelog

3 years agobase: Add sections to changelog
Ben Gamari [Mon, 21 Dec 2015 20:12:30 +0000 (21:12 +0100)] 
base: Add sections to changelog

3 years agotestsuite/ClassOperator: Mark as compile_fail instead of should_fail
Ben Gamari [Mon, 21 Dec 2015 19:34:40 +0000 (20:34 +0100)] 
testsuite/ClassOperator: Mark as compile_fail instead of should_fail

3 years agoAdded missing instances for Identity and Const (#11210)
Shane O'Brien [Mon, 21 Dec 2015 19:25:19 +0000 (20:25 +0100)] 
Added missing instances for Identity and Const (#11210)

The following instances are added

    instance Bounded a => Bounded (Const a b)
    instance Enum a => Enum (Const a b)
    instance Ix a => Ix (Const a b)
    instance Storable a => Storable (Const a b)

    instance Bounded a => Bounded (Identity a)
    instance Enum a => Enum (Identity a)
    instance Ix a => Ix (Identity a)
    instance Semigroup a => Semigroup (Identity a)
    instance Storable a => Storable (Identity a)

Reviewers: ekmett, RyanGlScott, rwbarton, hvr, austin, bgamari

Reviewed By: RyanGlScott, hvr

Subscribers: rwbarton, RyanGlScott, thomie

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

GHC Trac Issues: #11210

3 years agoFix #11256 by not immediately erroring if we can't find a module.
Edward Z. Yang [Mon, 21 Dec 2015 19:25:08 +0000 (20:25 +0100)] 
Fix #11256 by not immediately erroring if we can't find a module.

Test Plan: validate

Reviewers: austin, bgamari, thomie

Reviewed By: bgamari, thomie

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

GHC Trac Issues: #11256

3 years agoRename GHCi's UI modules into GHCi.UI(.*)
Herbert Valerio Riedel [Mon, 21 Dec 2015 14:17:42 +0000 (15:17 +0100)] 
Rename GHCi's UI modules into GHCi.UI(.*)

Further work refactoring and enhancing GHCi will make it desirable to
split up GHCi's code-base into multiple modules with specific functions,
and rather than have several top-level 'Ghci*' modules, it's nicer to
have a common namespace. This commit is provides the basis for that.

Note that the remaining GHCi.* namespace belongs to the new `ghci`
package.

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

3 years agoAdd proper GADTs support to Template Haskell
Jan Stolarek [Wed, 11 Nov 2015 09:49:22 +0000 (10:49 +0100)] 
Add proper GADTs support to Template Haskell

Until now GADTs were supported in Template Haskell by encoding them using
normal data types.  This patch adds proper support for representing GADTs
in TH.

Test Plan: T10828

Reviewers: goldfire, austin, bgamari

Subscribers: thomie, mpickering

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

GHC Trac Issues: #10828

3 years agotestsuite: Add testcase for #8316
Ben Gamari [Mon, 21 Dec 2015 19:22:49 +0000 (20:22 +0100)] 
testsuite: Add testcase for #8316

This is still broken but really out to be fixed. At least know we'll
know if someone fixes it inadvertently.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie

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

GHC Trac Issues: #8316

3 years agotestsuite/ClassOperator: This actually should_fail
Ben Gamari [Mon, 21 Dec 2015 18:13:17 +0000 (19:13 +0100)] 
testsuite/ClassOperator: This actually should_fail

See #11264 for details.

3 years agoTcTyClsDecls: Remove invalid comments about list monads
Ömer Sinan Ağacan [Mon, 21 Dec 2015 19:03:26 +0000 (14:03 -0500)] 
TcTyClsDecls: Remove invalid comments about list monads

3 years agoMaintain cost-centre stacks in the interpreter
Simon Marlow [Sat, 31 Oct 2015 17:38:34 +0000 (17:38 +0000)] 
Maintain cost-centre stacks in the interpreter

Summary:
Breakpoints become SCCs, so we have detailed call-stack info for
interpreted code.  Currently this only works when GHC is compiled with
-prof, but D1562 (Remote GHCi) removes this constraint so that in the
future call stacks will be available without building your own GHCi.

How can you get a stack trace?

* programmatically: GHC.Stack.currentCallStack
* I've added an experimental :where command that shows the stack when
  stopped at a breakpoint
* `error` attaches a call stack automatically, although since calls to
  `error` are often lifted out to the top level, this is less useful
  than it might be (ImplicitParams still works though).
* Later we might attach call stacks to all exceptions

Other related changes in this diff:

* I reduced the number of places that get ticks attached for
  breakpoints.  In particular there was a breakpoint around the whole
  declaration, which was often redundant because it bound no variables.
  This reduces clutter in the stack traces and speeds up compilation.

* I tidied up some RealSrcSpan stuff in InteractiveUI, and made a few
  other small cleanups

Test Plan: validate

Reviewers: ezyang, bgamari, austin, hvr

Subscribers: thomie

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

GHC Trac Issues: #11047

3 years agoEncode strictness in GHC generics metadata
RyanGlScott [Mon, 21 Dec 2015 15:11:25 +0000 (16:11 +0100)] 
Encode strictness in GHC generics metadata

This augments `MetaSel` with a `Bang` field, which gives generic
programmers access to the following information about each field
selector:

* `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`,
  `{-# UNPACK #-}`, or not
* `SourceStrictness`: whether a field was given a strictness (`!`) or
  laziness (`~`) annotation
* `DecidedStrictness`: what strictness GHC infers for a field during
  compilation, which may be influenced by optimization levels,
  `-XStrictData`, `-funbox-strict-fields`, etc.

Unlike in Phab:D1603, generics does not grant a programmer the ability
to "splice" in metadata, so there is no issue including
`DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to
be split off).

One consequence of this is that `MetaNoSel` had to be removed, since it
became redundant. The `NoSelector` empty data type was also removed for
similar reasons.

Fixes #10716.

Test Plan: ./validate

Reviewers: dreixel, goldfire, kosmikus, austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #10716

3 years agoFix-up GHC 7.12 artifacts
Herbert Valerio Riedel [Mon, 21 Dec 2015 17:37:37 +0000 (18:37 +0100)] 
Fix-up GHC 7.12 artifacts

The haddock submodule also still assumed that GHC 7.12 would be the next
major release (rather than GHC 8.0)

3 years agoFix AnnDotDot in module export
Alan Zimmerman [Mon, 21 Dec 2015 09:33:57 +0000 (11:33 +0200)] 
Fix AnnDotDot in module export

The annotation for the ".." in

    module GADTRecords2 (H1(..)) where

was in the wrong place

3 years agoMinor clean-up to ghc-bin.cabal.in
Herbert Valerio Riedel [Mon, 21 Dec 2015 13:38:27 +0000 (14:38 +0100)] 
Minor clean-up to ghc-bin.cabal.in

This has been factored out of D1673

3 years agotestsuite: Add ClassOperator testcase
Ben Gamari [Sun, 20 Dec 2015 14:21:10 +0000 (15:21 +0100)] 
testsuite: Add ClassOperator testcase

This is derived from Haddock's `Operators` `html-test`, which appears to
fail with GHC master yet compiles with 7.10.2

Reviewers: simonpj, austin

Subscribers: thomie

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

GHC Trac Issues: #11264

3 years agoImplement phase 1 of expanded Floating
Dan Doel [Sun, 20 Dec 2015 14:19:52 +0000 (15:19 +0100)] 
Implement phase 1 of expanded Floating

- This part of the proposal is to add log1p, expm1, log1pexp and
  log1mexp to the Floating class, and export the full Floating class
  from Numeric

Reviewers: ekmett, #core_libraries_committee, bgamari, hvr, austin

Reviewed By: ekmett, #core_libraries_committee, bgamari

Subscribers: Phyx, RyanGlScott, ekmett, thomie

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

GHC Trac Issues: #11166

3 years agoMove Const to own module in Data.Functor.Const and enable PolyKinds
Shane O'Brien [Sun, 20 Dec 2015 12:40:13 +0000 (13:40 +0100)] 
Move Const to own module in Data.Functor.Const and enable PolyKinds

`Const` from `Control.Applicative` can trivially be made
kind-polymorphic in its second argument. There has been a Trac issue
about this for nearly a year now. It doesn't look like anybody objects
to it, so I figured I might as well make a patch.

Trac Issues: #10039, #10865, #11135

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

Reviewers: ekmett, hvr, bgamari

Subscribers: RyanGlScott, thomie

3 years agoWarn about unused type variables in type families
Michał Sośnicki [Mon, 21 Dec 2015 11:29:03 +0000 (12:29 +0100)] 
Warn about unused type variables in type families

The warnings are enabled with the flag -fwarn-unused-matches, the same
one that enables warnings on the term level.

Identifiers starting with an underscore are now always parsed as type
variables.  When the NamedWildCards extension is enabled, the renamer
replaces those variables with named wildcards.

An additional NameSet nwcs is added to LocalRdrEnv. It's used to keep
names of the type variables that should be replaced with wildcards.

While renaming HsForAllTy, when a name is explicitly bound it is removed
from the nwcs NameSet. As a result, the renamer doesn't replace them in
the quantifier body. (Trac #11098)

Fixes #10982, #11098

Reviewers: alanz, bgamari, hvr, austin, jstolarek

Reviewed By: jstolarek

Subscribers: goldfire, mpickering, RyanGlScott, thomie

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

GHC Trac Issues: #10982

3 years agoModify IsString String instance (fixes #10814)
Dan Doel [Mon, 21 Dec 2015 11:28:16 +0000 (12:28 +0100)] 
Modify IsString String instance (fixes #10814)

The new instance resolves to `s ~ [Char]` as soon as we know that `s ~
[a]`, to avoid certain functions (like (++)) causing a situation where
`a` is ambiguous and (currently) unable to be defaulted.

Reviewers: #core_libraries_committee, hvr, austin, bgamari

Reviewed By: hvr, bgamari

Subscribers: thomie

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

GHC Trac Issues: #10814

3 years agoAdd Location to RdrName in FieldOcc
Alan Zimmerman [Sun, 20 Dec 2015 08:56:24 +0000 (10:56 +0200)] 
Add Location to RdrName in FieldOcc

Summary:
Post #11019, there have been some new instances of RdrName that are not
located, in particular

```#!hs
data FieldOcc name = FieldOcc { rdrNameFieldOcc  :: RdrName
                              , selectorFieldOcc :: PostRn name name
                              }

data AmbiguousFieldOcc name
  = Unambiguous RdrName (PostRn name name)
  | Ambiguous   RdrName (PostTc name name)
  deriving (Typeable)
```
Add locations to them

Updates haddock submodule to match

Test Plan: ./validate

Reviewers: goldfire, hvr, bgamari, austin

Reviewed By: hvr

Subscribers: hvr, thomie, mpickering

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

GHC Trac Issues: #11258

3 years agoTcTyClsDecls: Add a type annotation
Ömer Sinan Ağacan [Mon, 21 Dec 2015 03:37:50 +0000 (22:37 -0500)] 
TcTyClsDecls: Add a type annotation

3 years agoTcTyClsDecls: use zipWith3M_ instead of generating triplets
Ömer Sinan Ağacan [Mon, 21 Dec 2015 03:36:43 +0000 (22:36 -0500)] 
TcTyClsDecls: use zipWith3M_ instead of generating triplets

3 years agoDynFlags: call defaultWays when creating defaultFlags
Thomas Miedema [Sun, 13 Dec 2015 10:42:42 +0000 (11:42 +0100)] 
DynFlags: call defaultWays when creating defaultFlags

Instead of duplicating its logic. Refactoring only.

For reference, `defaultWays` looks like this:

  defaultWays :: Settings -> [Way]
  defaultWays settings = if pc_DYNAMIC_BY_DEFAULT (sPlatformConstants settings)
                        then [WayDyn]
                        else []

Reviewed by: bgamari

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

3 years agoAllow as-patterns in pattern synonym declarations.
Matthew Pickering [Sun, 20 Dec 2015 23:46:40 +0000 (23:46 +0000)] 
Allow as-patterns in pattern synonym declarations.

We can allow them if they contain no free variables. This patch just allows
them in one direction and not to be used as builders as the original ticket
suggests.

Test Plan: ./validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues:  #9739

Conflicts:
testsuite/tests/patsyn/should_fail/all.T

3 years agoDisallow empty where bindings in pattern synonym declarations.
Matthew Pickering [Sun, 20 Dec 2015 23:45:28 +0000 (23:45 +0000)] 
Disallow empty where bindings in pattern synonym declarations.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #10426

3 years agoUpdate binary submodule to final 0.8.0.0 release
Herbert Valerio Riedel [Sun, 20 Dec 2015 22:12:41 +0000 (23:12 +0100)] 
Update binary submodule to final 0.8.0.0 release

Also, `binary` now is almost warning free
(except for inlinePerformIO deprecation warnings)

/cc @kolmodin

3 years agoaclocal.m4: Fix llc/opt detection code
Herbert Valerio Riedel [Sun, 20 Dec 2015 20:29:51 +0000 (21:29 +0100)] 
aclocal.m4: Fix llc/opt detection code

Currently if llc/opt is missing, we get

  checking for llc-3.7... no
  checking for llc... no
  checking  is version 3.7... ./configure[7417]: --version:  not found
  no
  checking for opt-3.7... no
  checking for opt... no
  checking  is version 3.7... ./configure[7664]: --version:  not found
  no
  checking for llc... no
  checking for opt... no

With this fix, the version is queried iff `llc`/`opt` has been detected
at all, thereby avoiding the disturbing `--version: not found` error
output.

Reviewed By: thomie

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

3 years agoRemove unused/redundant fields from ghc-cabal.
Edward Z. Yang [Sun, 20 Dec 2015 19:22:50 +0000 (11:22 -0800)] 
Remove unused/redundant fields from ghc-cabal.

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

Reviewers: austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

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

3 years agoUpdate containers submodule to v0.5.7.1 release tag
Herbert Valerio Riedel [Sun, 20 Dec 2015 16:23:04 +0000 (17:23 +0100)] 
Update containers submodule to v0.5.7.1 release tag

This is the new designated release to go with GHC 8.0.1

This is only a meta-data change relative to v0.5.7.0

/cc @foxik

3 years agoMerge new commands from ghci-ng (re #10874)
Herbert Valerio Riedel [Sun, 20 Dec 2015 10:50:59 +0000 (11:50 +0100)] 
Merge new commands from ghci-ng (re #10874)

This adds the new commands `:all-types`, `:loc-at`, `:type-at`, and
`:uses` designed for editor-integration (such as Emacs' `haskell-mode`).

This was originally implemented by Chris Done on

  https://github.com/chrisdone/ghci-ng

and has been in use by Emacs' `haskell-mode` for over a year already,
and closely missed the GHC 7.10 release back then.

I've squashed the commits, rebased to GHC HEAD, and heavily refactored and
improved the patch.

Tests will be added in a separate commit.

Reviewed By: bgamari

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

3 years agoUpdate time submodule to v1.6 release
Herbert Valerio Riedel [Sun, 20 Dec 2015 09:26:54 +0000 (10:26 +0100)] 
Update time submodule to v1.6 release

This is the designated release to go with GHC 8.0.1

/cc @AshleyYakeley

3 years agoFix two occurences of `x86_HOST_ARCH`
Herbert Valerio Riedel [Sat, 19 Dec 2015 22:13:11 +0000 (23:13 +0100)] 
Fix two occurences of `x86_HOST_ARCH`

The proper name for the define is `i386_HOST_ARCH`

One was introduced back in 2011 via
035b8ebb5405efbcbfd3474821a877add1feca1e / #4914
and the other one more recently via
4905b83a2d448c65ccced385343d4e8124548a3b

We may want to add some validation to catch such typos early on...

Reviewed By: erikd

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

3 years agoFirst pass at cleaning up ghci.cabal
Herbert Valerio Riedel [Sat, 19 Dec 2015 18:35:31 +0000 (19:35 +0100)] 
First pass at cleaning up ghci.cabal

This prepares the meta-data of the new `ghci` package for Hackage

3 years agoFix typo in 7b8a8222e8f0
Herbert Valerio Riedel [Sat, 19 Dec 2015 18:34:16 +0000 (19:34 +0100)] 
Fix typo in 7b8a8222e8f0

[skip ci]

3 years agoMake ghc-boot Hackage-ready
Herbert Valerio Riedel [Sat, 19 Dec 2015 18:02:15 +0000 (19:02 +0100)] 
Make ghc-boot Hackage-ready

GHC 7.8 / base-4.7 is the oldest GHC/base version compatible with this
package, so let's declare this properly in the cabal file.

3 years agoAdd sparc64 a known architecture (Ticket #11211)
John Paul Adrian Glaubitz [Sat, 19 Dec 2015 09:39:25 +0000 (10:39 +0100)] 
Add sparc64 a known architecture (Ticket #11211)

Explicitly pass "--no-relax" on ArchSPARC64
(as ArchSPARC does) where gcc's default specs
set "-mrelax" which conflicts with "-Wl,-r".

Known architecture will also help extending
sparc NCG support 64-bit ABI.

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
3 years agoAdd -Nmax<n> RTS feature (#10728)
MarcelineVQ [Sat, 19 Dec 2015 10:10:54 +0000 (11:10 +0100)] 
Add -Nmax<n> RTS feature (#10728)

Added maximum core use based on processors
-Nmax<x> chooses the minimum of processor count or x
Added documentation.

Reviewed By: simonmar, thomie

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

3 years agoDocumentation, tests for hsc2hs's new #alignment macro
RyanGlScott [Sat, 19 Dec 2015 10:09:52 +0000 (11:09 +0100)] 
Documentation, tests for hsc2hs's new #alignment macro

Adds two tests (one for Trac #4340 and one for Trac #10272), as well as
advice on how to fix your code if `hsc2hs` emits warnings with GHC 8.0
due to a redefinition of `#alignment`. (I also put the advice in the
[GHC 8.0 Migration
Guide](https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0).)

Reviewed By: thomie

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

GHC Trac Issues: #4340, #10272

3 years agofix typo
Herbert Valerio Riedel [Fri, 18 Dec 2015 22:59:59 +0000 (23:59 +0100)] 
fix typo

[skip-ci]

3 years agoBump hsc2hs submodule
Ben Gamari [Sat, 19 Dec 2015 00:45:51 +0000 (01:45 +0100)] 
Bump hsc2hs submodule

Fixes #4340

3 years agoUpdate .mailmap [skip ci]
Thomas Miedema [Fri, 18 Dec 2015 02:34:42 +0000 (03:34 +0100)] 
Update .mailmap [skip ci]

3 years agoBuild system: fix 'make sdist'
Thomas Miedema [Sat, 19 Dec 2015 00:01:30 +0000 (01:01 +0100)] 
Build system: fix 'make sdist'

This was broken in 4905b83a2d448c65ccced385343d4e8124548a3b.

libraries/ghci/ghc.mk gets created by ./boot.

3 years agoUpdate terminfo submodule to v0.7.2.2 release
Herbert Valerio Riedel [Fri, 18 Dec 2015 21:15:50 +0000 (22:15 +0100)] 
Update terminfo submodule to v0.7.2.2 release

This is the designated release to go with GHC 8.0.1

/cc @judah

3 years agoUpdate terminfo submodule to v0.4.0.2 release
Herbert Valerio Riedel [Fri, 18 Dec 2015 21:14:04 +0000 (22:14 +0100)] 
Update terminfo submodule to v0.4.0.2 release

This is the designated release to go with GHC 8.0.1

/cc @judah

3 years agoFix build for AArch64/Arm64
Erik de Castro Lopo [Fri, 18 Dec 2015 11:07:43 +0000 (22:07 +1100)] 
Fix build for AArch64/Arm64

Test Plan: Build an AArch64 cross compiler.

Reviewers: hvr, bgamari, austin

Reviewed By: bgamari

Subscribers: thomie

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

3 years agoLLVM backend: Show expected LLVM version in warnings/errors
Ömer Sinan Ağacan [Fri, 18 Dec 2015 17:21:47 +0000 (12:21 -0500)] 
LLVM backend: Show expected LLVM version in warnings/errors

Summary:
Before:

    [1 of 1] Compiling Main             ( Main.hs, Main.o )
    You are using a new version of LLVM that hasn't been tested yet!
    We will try though...

After:

    [1 of 1] Compiling Main             ( Main.hs, Main.o )
    You are using an unsupported version of LLVM!
    Currently only 3.7 is supported.
    We will try though...

Before:

    [1 of 1] Compiling Main             ( Main.hs, Main.o )

    <no location info>:
        Warning: Couldn't figure out LLVM version!
                 Make sure you have installed LLVM
    ghc: could not execute: opt

After:

    [1 of 1] Compiling Main             ( Main.hs, Main.o )

    <no location info>: error:
        Warning: Couldn't figure out LLVM version!
                 Make sure you have installed LLVM 3.7
    ghc-stage1: could not execute: opt

Reviewers: austin, rwbarton, bgamari

Subscribers: thomie

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

3 years agoghc.cabal: Backpack directory no longer exists
Ben Gamari [Fri, 18 Dec 2015 16:22:39 +0000 (17:22 +0100)] 
ghc.cabal: Backpack directory no longer exists

Reviewers: austin

Subscribers: thomie, ezyang

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

3 years agoAdd test for T11122
Ben Gamari [Fri, 18 Dec 2015 16:22:15 +0000 (17:22 +0100)] 
Add test for T11122

Test Plan: validate

Reviewers: austin

Subscribers: thomie

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

GHC Trac Issues: #11122

3 years agoSrcLoc: Eliminate constructors of RealSrcSpan
Ben Gamari [Fri, 18 Dec 2015 16:21:22 +0000 (17:21 +0100)] 
SrcLoc: Eliminate constructors of RealSrcSpan

This type is occurs very often but previously had multiple, meaning it
could not be unboxed. Even worse, these constructors didn't offer any
compelling safety benefits. Thankfully, the type is abstract, so
changing the representation to be a single-constructor type was quite
straightforward.

Reviewers: austin

Subscribers: alanz, thomie, hvr

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

3 years agotcCheckSatisfiability: less aggressive superclass expansion
Simon Peyton Jones [Fri, 18 Dec 2015 15:34:17 +0000 (15:34 +0000)] 
tcCheckSatisfiability: less aggressive superclass expansion

In the pattern-match check we are looking for a proof of
*unsatisfiablity* among a bunch of givens.  The unsat-ness might be
hidden in the superclasses, so we must expand them.  But in the common
case where the constraints are satisfiable, we don't want to expand
a recursive superclass forever.

This is all a bit arbitrary, but then the whole question is
undecidable anyway.

The bug in Trac #10592 comment:12 was that I expanded superclasses
forever.  This patch fixes it.

3 years agoTest Trac #11248, #11249
Simon Peyton Jones [Fri, 18 Dec 2015 15:30:45 +0000 (15:30 +0000)] 
Test Trac #11248, #11249

3 years agoconfigure.ac: Rename build/ to shake-build/
Ben Gamari [Fri, 18 Dec 2015 12:33:42 +0000 (13:33 +0100)] 
configure.ac: Rename build/ to shake-build/

Last naming change... I promise.

3 years agoconfigure.ac: Rename shake/ to build/
Ben Gamari [Fri, 18 Dec 2015 10:57:52 +0000 (11:57 +0100)] 
configure.ac: Rename shake/ to build/

See https://github.com/snowleopard/shaking-up-ghc/pull/2

3 years agoGHCi.Run: Remove redundant language pragma
Ben Gamari [Fri, 18 Dec 2015 10:56:37 +0000 (11:56 +0100)] 
GHCi.Run: Remove redundant language pragma

3 years agoUpdate Win32 submodule to fix 77b7f24543f fallout
Herbert Valerio Riedel [Fri, 18 Dec 2015 11:56:38 +0000 (12:56 +0100)] 
Update Win32 submodule to fix 77b7f24543f fallout

Turns out Win32 wasn't de-tabbed yet... sigh...

[skip ci]

3 years agoComments only
Simon Peyton Jones [Fri, 18 Dec 2015 08:50:37 +0000 (08:50 +0000)] 
Comments only

3 years agoUpdate directory submodule to v1.2.5.0 release
Herbert Valerio Riedel [Fri, 18 Dec 2015 09:53:17 +0000 (10:53 +0100)] 
Update directory submodule to v1.2.5.0 release

This is the designated release to go with GHC 8.0.1

3 years agoFix PowerPC build
Erik de Castro Lopo [Fri, 18 Dec 2015 09:21:19 +0000 (20:21 +1100)] 
Fix PowerPC build

Summary:
Replace incorrect `ppc_HOST_ARCH` with `powerpc_HOST_ARCH`.

Test Plan: Build on PowerPC

Reviewers: hvr, austin, bgamari

Subscribers: thomie

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

3 years agoUse `-Wno-tabs` more targetted
Herbert Valerio Riedel [Fri, 18 Dec 2015 09:45:22 +0000 (10:45 +0100)] 
Use `-Wno-tabs` more targetted

So far only `time` (fixed upstream already though) and `xhtml` still require
`-Wno-tabs`, so let's apply that warning suppression flag only there.

This also updates the haskeline submodule to pull in a tab-fix

3 years agoDocumentation for -fexternal-interpreter
Simon Marlow [Fri, 18 Dec 2015 09:08:36 +0000 (09:08 +0000)] 
Documentation for -fexternal-interpreter

3 years agoTestsuite Windows: fix ghcpkg03 and ghcpkg05
Thomas Miedema [Thu, 17 Dec 2015 23:49:45 +0000 (00:49 +0100)] 
Testsuite Windows: fix ghcpkg03 and ghcpkg05

3 years agoTestsuite Windows: fix sigof01m, sigof012m and sigof02dm
Thomas Miedema [Thu, 17 Dec 2015 23:45:28 +0000 (00:45 +0100)] 
Testsuite Windows: fix sigof01m, sigof012m and sigof02dm

3 years agoTestsuite: widen lazy-bs-alloc 3->5%
Thomas Miedema [Thu, 17 Dec 2015 23:36:36 +0000 (00:36 +0100)] 
Testsuite: widen lazy-bs-alloc 3->5%

3 years agoghci: fix UNREG build (missing fromJust import)
Sergei Trofimovich [Fri, 18 Dec 2015 00:00:41 +0000 (00:00 +0000)] 
ghci: fix UNREG build (missing fromJust import)

libraries/ghci/GHCi/InfoTable.hsc:249:45: error:
    • Variable not in scope: fromJust :: Maybe EntryFunPtr -> a0
    • Perhaps you meant ‘fromList’ (imported from GHC.Exts)

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Test Plan: build --enable-unregisterised ghc

Reviewers: simonmar, bgamari, austin

Reviewed By: austin

Subscribers: thomie

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

3 years agoRandom typo fixes
Herbert Valerio Riedel [Thu, 17 Dec 2015 22:59:59 +0000 (23:59 +0100)] 
Random typo fixes

[skip ci]

3 years agoUpdate containers submodule to v0.5.7.0 release
Herbert Valerio Riedel [Thu, 17 Dec 2015 22:30:53 +0000 (23:30 +0100)] 
Update containers submodule to v0.5.7.0 release

This is the designated release to go with GHC 8.0.1

This release doesn't need any warning-suppression flags anymore, so
remove those from mk/warnings.mk

/cc @foxik

3 years agoMove Data.Functor.(Classes,Compose,Product,Sum) into base
RyanGlScott [Thu, 17 Dec 2015 19:22:25 +0000 (20:22 +0100)] 
Move Data.Functor.(Classes,Compose,Product,Sum) into base

These modules were previously provided by the `transformers`
package. Hence the submodule update.

This patch was originally contributed by M Farkas-Dyck and
subsequently taken over and completed by Ryan.

The original proposal discussion can be found at
https://mail.haskell.org/pipermail/libraries/2015-July/026014.html

This addresses #11135

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

3 years agoTestsuite: mark frontend01 conditionally expect_broken on #10301
Thomas Miedema [Thu, 17 Dec 2015 20:42:04 +0000 (21:42 +0100)] 
Testsuite: mark frontend01 conditionally expect_broken on #10301

This should fix validate on Travis.

3 years agoSuppress warnings when compiling primitive and random
Thomas Miedema [Thu, 22 Oct 2015 15:50:03 +0000 (17:50 +0200)] 
Suppress warnings when compiling primitive and random

And fix a redundant constraint warning in a test that requires
primitive.

3 years agoBuild system: allow bindist without docs
Thomas Miedema [Tue, 27 Oct 2015 22:43:58 +0000 (23:43 +0100)] 
Build system: allow bindist without docs

Useful for testing 'make binary-dist-prep' when HADDOCK_DOCS=NO.

Reviewed by: bgamari

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

3 years agoTestsuite: allow spaces in TEST_HC passed in by the user
Thomas Miedema [Wed, 28 Oct 2015 09:35:08 +0000 (10:35 +0100)] 
Testsuite: allow spaces in TEST_HC passed in by the user

Don't use the GNU make function 'realpath' (reverting e66a81c6),
because it doesn't handle spaces in paths. Instead, use 'cygpath' to
convert Windows style paths (e.g. C:/foo/) to mingw style paths (e.g.
c/foo/), and then call 'which'.

Tests:
 * make TEST_HC=ghc
 * make TEST_HC=/d/home/thomie/ghc-validate/bindisttest/install\ \ \ dir/bin/ghc
 * make TEST_HC=D:/home/thomie/ghc-validate/bindisttest/install\ \ \ dir/bin/ghc

Reviewed by: Phyx

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

3 years agoBuild system: also put scripts in libexecdir/bin
Thomas Miedema [Thu, 17 Dec 2015 18:45:13 +0000 (19:45 +0100)] 
Build system: also put scripts in libexecdir/bin

This follows a similar change in
4905b83a2d448c65ccced385343d4e8124548a3b, where binaries are installed
in libexecdir/bin instead of libexecdir.

This fixes a problem with ghc not able to find ghc-split, when
SplitObjs=YES.

3 years agoFix #11230.
Richard Eisenberg [Tue, 15 Dec 2015 22:36:32 +0000 (17:36 -0500)] 
Fix #11230.

Previously, we were optimizing away all case expressions over
coercions with dead binders. But sometimes we want to force
the coercion expression. Like when it contains an error.

Test case: typecheck/should_run/T11230

3 years agoFix tcTyClTyVars to handle SigTvs
Richard Eisenberg [Tue, 15 Dec 2015 18:47:14 +0000 (13:47 -0500)] 
Fix tcTyClTyVars to handle SigTvs

Previously, tcTyClTyVars required that the names of the LHsQTyVars
matched up exactly with the names of the kind of the given TyCon.
It now does a bit of matching up when necessary to relax this
restriction.

This commit enables a few tests that had previously been disabled.

The shortcoming this addresses is discussed in #11203, but that
ticket is not directly addressed here.

Test case: polykinds/SigTvKinds, perf/compiler/T9872d

3 years agoIO Handles: update comments [skip ci]
Thomas Miedema [Mon, 14 Dec 2015 16:00:27 +0000 (17:00 +0100)] 
IO Handles: update comments [skip ci]

* hSetEcho, hGetEcho and hIsTerminalDevice are part of the Haskell2010
report (but not Haskell98)

* there are great `Note`s in GHC.IO.Handle.Types. Link to them.

3 years agoLexer: update outdated comments [skip ci]
Thomas Miedema [Wed, 11 Nov 2015 01:17:56 +0000 (02:17 +0100)] 
Lexer: update outdated comments [skip ci]

The test for TemplateHaskell was removed in
09015be8d580bc33f5f1960c8e31d00ba7a459a1.

3 years agoTestsuite: #10712 is fixed
Thomas Miedema [Thu, 17 Dec 2015 17:18:30 +0000 (18:18 +0100)] 
Testsuite: #10712 is fixed

Verified by running:

  make TEST='exceptionsrun001 T3279 conc012 conc014' slowtest

3 years agoRemove warning-suppression flags for Cabal
Herbert Valerio Riedel [Thu, 17 Dec 2015 15:52:55 +0000 (16:52 +0100)] 
Remove warning-suppression flags for Cabal

Cabal is currently warning free. So let's drop the `-w`-flags.

/cc @dcoutts

3 years agoDisable recomp015 on ARM
Ben Gamari [Thu, 17 Dec 2015 14:24:41 +0000 (15:24 +0100)] 
Disable recomp015 on ARM

Due to differences in assembly syntax. See #11022.

3 years agoT9961 allocations crept further upwards
Ben Gamari [Thu, 17 Dec 2015 14:10:18 +0000 (16:10 +0200)] 
T9961 allocations crept further upwards

Sad.

3 years agoUpdate Cabal submodule
Ben Gamari [Thu, 17 Dec 2015 12:41:09 +0000 (13:41 +0100)] 
Update Cabal submodule

Previously it didn't build on Windows.

3 years agoRemove unused T10524.stderr
Simon Peyton Jones [Wed, 16 Dec 2015 10:38:54 +0000 (10:38 +0000)] 
Remove unused T10524.stderr

3 years agoImprove pretty-printing in pprIfaceIdBndr
Simon Peyton Jones [Mon, 14 Dec 2015 13:34:26 +0000 (13:34 +0000)] 
Improve pretty-printing in pprIfaceIdBndr

In particular, add parnes when we need an explicit type.

3 years agousers_guide: Remove extraneous vertical whitespace
Ben Gamari [Thu, 17 Dec 2015 11:26:43 +0000 (12:26 +0100)] 
users_guide: Remove extraneous vertical whitespace

3 years agoAdd -fprint-typechecker-elaboration flag (fixes #10662)
Eugene Akentyev [Thu, 17 Dec 2015 11:22:44 +0000 (12:22 +0100)] 
Add -fprint-typechecker-elaboration flag (fixes #10662)

Reviewers: thomie, austin, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

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

GHC Trac Issues: #10662

3 years agoReify DuplicateRecordFields by label, rather than by selector
Adam Gundry [Thu, 17 Dec 2015 11:19:23 +0000 (12:19 +0100)] 
Reify DuplicateRecordFields by label, rather than by selector

See `Note [Reifying field labels]` in `TcSplice`. This makes
typical uses of TH work better with `DuplicateRecordFields`.
If `reify` is called on the `Name` of a field label produced by
the output of a previous `reify`, and there are multiple  fields
with that label defined in the same module, it may fail with
an ambiguity error.

Test Plan:
Added tests, and manually tested that this makes
Aeson's `deriveJSON` avoid the `$sel:` prefixes.

Reviewers: simonpj, goldfire, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11103

3 years agoFix #11232.
Richard Eisenberg [Thu, 17 Dec 2015 11:18:47 +0000 (12:18 +0100)] 
Fix #11232.

I somehow forgot to propagate roles into UnivCos. Very
simple fix, happily.

Test Plan: simplCore/should_compile/T11232

Reviewers: bgamari, austin, simonpj

Reviewed By: simonpj

Subscribers: simonpj, thomie

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

GHC Trac Issues: #11232

3 years agoConditionally show plural "s" in warnings
David Luposchainsky [Thu, 17 Dec 2015 11:17:32 +0000 (12:17 +0100)] 
Conditionally show plural "s" in warnings

Redundant constraints and defaulting warnings had "constraint(s)" in
their messages; the "s" is now conditional based on the number of things
warned about.

Reviewers: hvr, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

3 years agorules/haddock: Add EXTRA_HADDOCK_OPTS flag
Ben Gamari [Thu, 17 Dec 2015 11:15:27 +0000 (12:15 +0100)] 
rules/haddock: Add EXTRA_HADDOCK_OPTS flag

Allowing one to pass the new `--hyperlinked-source` option to generate
pretty marked-up sources for the core libraries.

Test Plan: Try it

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: thomie

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

3 years agoBuild system: Make cGhcRtsWithLibdw flag a proper Bool
Ben Gamari [Thu, 17 Dec 2015 11:14:53 +0000 (12:14 +0100)] 
Build system: Make cGhcRtsWithLibdw flag a proper Bool

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie

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