ghc.git
19 months agoAdd -fexternal-dynamic-refs
Simon Marlow [Wed, 28 Feb 2018 19:03:37 +0000 (11:03 -0800)] 
Add -fexternal-dynamic-refs

Summary:
The `-dynamic` flag does two things:

* In the code generator, it generates code designed to link against
  external shared libraries.  References outside of the current module
  go through platform-specific indirection tables (e.g. the GOT on ELF).

* It enables a "way", which changes which hi files we look
  for (`Foo.dyn_hi`) and which libraries we link against.

Some specialised applications want the first of these without the
second. (I could go into detail here but it's probably not all that
important).

This diff splits out the code-generation effects of `-dynamic` from the
"way" parts of its behaviour, via a new flag `-fexternal-dynamic-refs`.

Test Plan: validate

Reviewers: niteria, bgamari, erikd

Subscribers: rwbarton, thomie, carter

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

19 months agoFix typo in description of -V RTS flag
Tej Chajed [Tue, 6 Mar 2018 18:46:01 +0000 (13:46 -0500)] 
Fix typo in description of -V RTS flag

19 months agoUsers Guide: Add that --numa is available on Windows too
Simon Jakobi [Mon, 5 Mar 2018 05:19:20 +0000 (06:19 +0100)] 
Users Guide: Add that --numa is available on Windows too

Windows support was added in c93813d96b1da53a2ebd9c9ac5af6cc3e3443c43

19 months agoFix a typo about pattern synonyms in documentation.
HE, Tao [Mon, 5 Mar 2018 15:52:29 +0000 (23:52 +0800)] 
Fix a typo about pattern synonyms in documentation.

19 months agoUse docker images with non-root user
mrkkrp [Wed, 28 Feb 2018 09:33:59 +0000 (16:33 +0700)] 
Use docker images with non-root user

That image creates an unprivileged user to run the test suite under.

19 months agoSchedule.c: remove unreachable code block
Ömer Sinan Ağacan [Wed, 7 Mar 2018 11:34:46 +0000 (14:34 +0300)] 
Schedule.c: remove unreachable code block

19 months agoAdd bindist-list.uniq to .gitignore
Ömer Sinan Ağacan [Wed, 7 Mar 2018 10:01:20 +0000 (13:01 +0300)] 
Add bindist-list.uniq to .gitignore

19 months agoAdd perf test for #14052
Ömer Sinan Ağacan [Wed, 7 Mar 2018 08:52:05 +0000 (11:52 +0300)] 
Add perf test for #14052

19 months agoFix interpreter with profiling
Simon Marlow [Mon, 5 Mar 2018 20:12:57 +0000 (15:12 -0500)] 
Fix interpreter with profiling

This was broken by D3746 and/or D3809, but unfortunately we didn't
notice because CI at the time wasn't building the profiling way.

Test Plan:
```
cd testsuite/test/profiling/should_run
make WAY=ghci-ext-prof
```

Reviewers: bgamari, michalt, hvr, erikd

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14705

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

19 months agoBump nofib submodule
Ben Gamari [Mon, 5 Mar 2018 20:30:25 +0000 (15:30 -0500)] 
Bump nofib submodule

19 months agoMake accumArray and accum stricter
David Feuer [Mon, 5 Mar 2018 20:18:05 +0000 (15:18 -0500)] 
Make accumArray and accum stricter

`accumArray` was lazier than documented. `accum` did not have
documented strictness. The extra laziness allowed thunks to build
up in the array. Force the results of applying the accumulating
function to resolve.

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: alpmestan, rwbarton, thomie, carter

GHC Trac Issues: #14785

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

19 months agocmm/: Avoid using lazy left folds
Michal Terepeta [Mon, 5 Mar 2018 20:16:02 +0000 (15:16 -0500)] 
cmm/: Avoid using lazy left folds

This basically replaces all uses of `foldl` with `foldl'`. I've looked
at all the call sites and there doesn't seem to be any reason to prefer
the lazy version.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: ./validate

Reviewers: bgamari, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoCorrect -g flag description
Bartosz Nitka [Mon, 5 Mar 2018 19:10:11 +0000 (11:10 -0800)] 
Correct -g flag description

Since 7aaeaf81ea95c36fe1dc4da449cf6092a792fd09
`-g1` and `-g2` are actually different.
The tutorial below is correct.

Test Plan: harbormaster

Reviewers: bgamari, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoAllow top level ticked string literals
Bartosz Nitka [Fri, 2 Mar 2018 13:33:07 +0000 (05:33 -0800)] 
Allow top level ticked string literals

This reverts f5b275a239d2554c4da0b7621211642bf3b10650
and changes the places that looked for `Lit (MachStr _))`
to use `exprIsMbTickedLitString_maybe` to unwrap ticks as
necessary.
Also updated relevant comments.

Test Plan:
I added 3 new tests that previously reproduced.
GHC HEAD now builds with -g

Reviewers: simonpj, simonmar, bgamari, hvr, goldfire

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14779

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

19 months agoSchedule.c: remove a redundant CPP guard
Ömer Sinan Ağacan [Tue, 6 Mar 2018 11:16:00 +0000 (14:16 +0300)] 
Schedule.c: remove a redundant CPP guard

(the CPP guard is already wrapped with the same guard in line 1549)

19 months agoadd CCX=$(CXX) to integer-gmp
Moritz Angermann [Tue, 6 Mar 2018 03:20:22 +0000 (11:20 +0800)] 
add CCX=$(CXX) to integer-gmp

Summary:
This came up when trying to build GHC HEAD with nix. We
do not set CCX for integer-gmp when running ./configure. We do
this however for libffi.

The result is, that if CCX is not set, we default to the system
one, of which there might be none (as in nixos's case).  This
will not show on a debian+nix or similar setup, where the system
`cxx` is still in place, and only shows up when the system tries
hard to sandbox everything (even cxx) as nixOS does.

We use `CXX`, which is set to either `clang` or `CC_STAGE1`, and
also usedfor `CC`, similar to what we do for libffi.c

Test Plan: ./validate

Reviewers: bgamari, hvr

Reviewed By: hvr

Subscribers: rwbarton, thomie, carter

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

19 months ago`--via-asm` only for windows targets
Moritz Angermann [Mon, 5 Mar 2018 09:18:25 +0000 (17:18 +0800)] 
`--via-asm` only for windows targets

Reviewers: trofi, bgamari

Reviewed By: trofi, bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoFixup include of gmp/config.mk to use new location
Herbert Valerio Riedel [Mon, 5 Mar 2018 20:13:28 +0000 (21:13 +0100)] 
Fixup include of gmp/config.mk to use new location

This wasn't spotted rightaway in
8f0b2f5eadf0fcb47c581907205a9db686214a69
because the include-site deliberately ignored include-errors as
a Hack with the justification below:

> Hack. The file gmp/config.mk doesn't exist yet after running ./configure in
> the toplevel (ghc) directory. To let some toplevel make commands such as
> sdist go through, right after ./configure, don't consider this an error.

This may have contributed to #14891.

19 months agoSimplify rnLHsInstType
Simon Peyton Jones [Mon, 5 Mar 2018 14:40:37 +0000 (14:40 +0000)] 
Simplify rnLHsInstType

This patch is preparatory for the main fix for Trac #13324

Here, we simplify rnLHsInstType so that it does not try
to figure out the class name.  This turns out to have a good
(rather than bad) effect on error messages, and it prepares
the way for the main event.

Plus, less code!

19 months agoFix #14888 by adding more special cases for ArrowT
Ryan Scott [Mon, 5 Mar 2018 13:57:04 +0000 (08:57 -0500)] 
Fix #14888 by adding more special cases for ArrowT

Summary:
There were previously some situations where `(->)` would
not be desugared or reified as `ArrowT`, leading to various oddities
such as those observed in #14888. We now uniformly treat `(->)` as
`ArrowT` in Template Haskell–world by checking for any tycon that
has the same name as `(->)`, and converting that to `ArrowT`.

Test Plan: make test TEST=T14888

Reviewers: goldfire, bgamari, simonpj

Reviewed By: goldfire, simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #14888

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

19 months agoRespect Note [The tcType invariant]
Simon Peyton Jones [Fri, 2 Mar 2018 17:26:58 +0000 (17:26 +0000)] 
Respect Note [The tcType invariant]

I tried to do this with

    commit 0a12d92a8f65d374f9317af2759af2b46267ad5c
    Author: Simon Peyton Jones <simonpj@microsoft.com>
    Date:   Wed Dec 13 12:53:26 2017 +0000

    Further improvements to well-kinded types

    The typechecker has the invariant that every type should be well-kinded
    as it stands, without zonking.  See Note [The well-kinded type invariant]
    in TcType.

    That invariant was not being upheld, which led to Trac #14174.  I fixed
    part of it, but T14174a showed that there was more.  This patch finishes
    the job.

But I didn't get it quite right as Trac #14873 showed.

This patch fixes the problem; although I am still a bit unhappy.
(See "A worry" in the HsApp case of tc_infer_hs_type.)

19 months agoWombling around in Trac #14808
Simon Peyton Jones [Fri, 2 Mar 2018 17:12:03 +0000 (17:12 +0000)] 
Wombling around in Trac #14808

Comment:4 in Trac #14808 explains why I'm unhappy with the current
state of affairs -- at least the lack of documentation.

This smallpatch does nothing major:

* adds comments
* uses existing type synonyms more (notably FreeKiTyVarsWithDups)
* adds another test case to T14808

19 months agoBump Cabal submodule
Ben Gamari [Sun, 4 Mar 2018 03:05:44 +0000 (22:05 -0500)] 
Bump Cabal submodule

19 months agoBump Cabal submodule to 2.2
Moritz Angermann [Sat, 3 Mar 2018 21:16:41 +0000 (16:16 -0500)] 
Bump Cabal submodule to 2.2

Requires some ghc-cabal changes as well.

Test Plan: ./validate

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: hsyl20, erikd, alpmestan, rwbarton, thomie, carter

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

19 months agoBump hsc2hs submodule
Moritz Angermann [Sun, 4 Mar 2018 02:37:58 +0000 (10:37 +0800)] 
Bump hsc2hs submodule

This should have been part of 5f6fcf78.

19 months agoParenthesize (() :: Constraint) in argument position
Ryan Scott [Sat, 3 Mar 2018 18:48:38 +0000 (13:48 -0500)] 
Parenthesize (() :: Constraint) in argument position

Summary:
A simple oversight in the pretty-printer lead to a special
case for `() :: Constraint` not being parenthesized correctly when
used in an argument position. Easily fixed with a `maybeParen`.

Test Plan: make test TEST=T14796

Reviewers: alanz, goldfire, bgamari, simonpj

Reviewed By: bgamari, simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #14796

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

19 months agoFix the coverage checker's treatment of existential tyvars
Ryan Scott [Fri, 2 Mar 2018 21:18:04 +0000 (16:18 -0500)] 
Fix the coverage checker's treatment of existential tyvars

Previously, the pattern-match coverage checker was far too
eager to freshen the names of existentially quantified type
variables, which led to incorrect sets of type constraints that
misled GHC into thinking that certain programs that involve nested
GADT pattern matches were non-exhaustive (when in fact they were).
Now, we generate extra equality constraints in the ConCon case of
the coverage algorithm to ensure that these fresh tyvars align
with existing existential tyvars. See
`Note [Coverage checking and existential tyvars]` for the full story.

Test Plan: make test TEST="T11984 T14098"

Reviewers: gkaracha, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #11984, #14098

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

19 months agoCorrect default -A value in RTS flag usage info
Simon Jakobi [Fri, 2 Mar 2018 21:17:44 +0000 (16:17 -0500)] 
Correct default -A value in RTS flag usage info

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agodoCorePass: Expand catch-all
Simon Jakobi [Fri, 2 Mar 2018 21:17:12 +0000 (16:17 -0500)] 
doCorePass: Expand catch-all

This doesn't remedy problem, but at least it's more explicit than
the catch-all

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14544

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

19 months agoCompile with `--via-asm` when cross compiling.
Moritz Angermann [Fri, 2 Mar 2018 21:16:52 +0000 (16:16 -0500)] 
Compile with `--via-asm` when cross compiling.

This bumps `hsc2hs` and adds the new `--via-asm` flag,
which allows to successfully cross compile the win32
lirbary.

- Compile with `--via-asm` when cross compiling. This requires
haskell/hsc2hs#5 (https://github.com/haskell/hsc2hs/pull/5)

Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoFix #14838 by marking TH-spliced code as FromSource
Ryan Scott [Fri, 2 Mar 2018 21:16:17 +0000 (16:16 -0500)] 
Fix #14838 by marking TH-spliced code as FromSource

Previously, any Template Haskell code that was spliced would
be marked as `Generated`, which would completely suppress pattern-
match coverage warnings for it, which several folks found confusing.
Indeed, Template Haskell-spliced code is "source" code in some sense,
as users specifically request that it be put into their program, so
changing its designation to `FromSource` makes sense from that
perspective.

Test Plan: make test TEST=T14838

Reviewers: goldfire, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14838

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

19 months agoPermit conversion of partially applied PromotedTupleTs
Ryan Scott [Fri, 2 Mar 2018 21:15:38 +0000 (16:15 -0500)] 
Permit conversion of partially applied PromotedTupleTs

Summary:
We were simply missing a case in `Convert` for when have a
`PromotedTupleT` that wasn't fully saturated. Easily fixed.

Test Plan: make test TEST=T14843

Reviewers: goldfire, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14843

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

19 months agoAdds *-cross-ncg flavour.
Moritz Angermann [Fri, 2 Mar 2018 21:15:09 +0000 (16:15 -0500)] 
Adds *-cross-ncg flavour.

Our *-cross flavours force -fllvm, this adds flavours for cross
compilation to x86_64, where we can use our native code generator.

Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoAdd Applicative, Semigroup, and Monoid instances in GHC.Generics
Lysxia [Fri, 2 Mar 2018 21:14:36 +0000 (16:14 -0500)] 
Add Applicative, Semigroup, and Monoid instances in GHC.Generics

Reviewers: hvr, bgamari, alpmestan, RyanGlScott

Reviewed By: RyanGlScott

Subscribers: RyanGlScott, rwbarton, thomie, carter

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

19 months agoconfigure: Enable LD_NO_GOLD is set in all codepaths
Ben Gamari [Fri, 2 Mar 2018 21:13:53 +0000 (16:13 -0500)] 
configure: Enable LD_NO_GOLD is set in all codepaths

Test Plan: `./configure --disable-ld-override; make; make install`

Reviewers: trofi, hvr

Reviewed By: trofi

Subscribers: rwbarton, thomie, erikd, carter, simonmar

GHC Trac Issues: #14675

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

19 months agorts/win32: Assert that the IO manager has been initialised
Simon Jakobi [Fri, 2 Mar 2018 21:13:26 +0000 (16:13 -0500)] 
rts/win32: Assert that the IO manager has been initialised

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoAdd @since annotations for derived instances in base
Chaitanya Koparkar [Fri, 2 Mar 2018 21:12:56 +0000 (16:12 -0500)] 
Add @since annotations for derived instances in base

Test Plan: ./validate

Reviewers: hvr, goldfire, bgamari, RyanGlScott

Reviewed By: RyanGlScott

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #11767

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

19 months agoImprove missing-home-modules warning formatting
Matthew Pickering [Fri, 2 Mar 2018 21:12:22 +0000 (16:12 -0500)] 
Improve missing-home-modules warning formatting

Previously the modules were smashed together at the end of the line. As
the header is quite long, this meant for quite long lines which wrapped
on smaller terminals.

err msg: A
         B

Now they are nested underneath the long first line of the error message.

err msg:
  A
  B

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoGHCi info: Use src file for cache invalidation
alexbiehl [Fri, 2 Mar 2018 21:11:45 +0000 (16:11 -0500)] 
GHCi info: Use src file for cache invalidation

Prior to this patch GHCi used the modification time of a module's object
file to invalidate the info cache.

We now look at the modification time of the source file, if present.

This addresses part of
https://ghc.haskell.org/trac/ghc/ticket/12706#comment:3.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: lelf, alpmestan, rwbarton, thomie, carter

GHC Trac Issues: #12706

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

19 months agoDynFlags: Support British spelling of GeneralisedNewtypeDeriving
Ben Gamari [Fri, 2 Mar 2018 19:18:48 +0000 (14:18 -0500)] 
DynFlags: Support British spelling of GeneralisedNewtypeDeriving

Reviewers: dfeuer

Reviewed By: dfeuer

Subscribers: dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #14819

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

19 months agoVarious Windows / Cross Compile to Windows fixes
Moritz Angermann [Fri, 2 Mar 2018 19:19:58 +0000 (14:19 -0500)] 
Various Windows / Cross Compile to Windows fixes

- Adds quick-cross-ncg flavour.
- Fix windows wchar with `_s` for mingw
- Lookup windres, dllwrap and objdump
- Fix type.

Reviewers: bgamari, hvr, Phyx, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, erikd, carter

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

19 months agoFix #14817 by not double-printing data family instance kind signatures
Ryan Scott [Fri, 2 Mar 2018 19:18:15 +0000 (14:18 -0500)] 
Fix #14817 by not double-printing data family instance kind signatures

Within `pprDataFamInstDecl`, we were invoking `pprFamInstLHS` to
pretty-print a data family instance header, and we were passing `Just` a
kind signature to `pprFamInstLHS` to make it pretty-print the kind
signature alongside it (this is a consequence of commit
d1ef223cfebd23c25489a4b0c67fbaa2f91c1ec6). But this is silly, because
then invoke `pp_data_defn`, which //also// pretty-prints the kind
signature, resulting in the kind signature being printed twice by
mistake.

This fix is simple—pass `Nothing` to `pprFamInstLHS` instead.

Test Plan: make test TEST=T14817

Reviewers: alanz, bgamari, mpickering

Reviewed By: mpickering

Subscribers: mpickering, rwbarton, thomie, carter

GHC Trac Issues: #14817

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

19 months agoAdd regression test for #12790
Ryan Scott [Fri, 2 Mar 2018 19:17:52 +0000 (14:17 -0500)] 
Add regression test for #12790

Test Plan: make test TEST=T12790

Reviewers: bgamari, mpickering

Reviewed By: mpickering

Subscribers: mpickering, dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #12790

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

19 months agoImprove exhaustive checking for guards in pattern bindings and MultiIf.
HE, Tao [Fri, 2 Mar 2018 19:16:24 +0000 (14:16 -0500)] 
Improve exhaustive checking for guards in pattern bindings and MultiIf.

Previously we didn't do exhaustive checking on MultiIf expressions
and guards in pattern bindings.

We can construct the `LMatch` directly from GRHSs or [LHsExpr]
(MultiIf's alts) then feed it to checkMatches, without construct the
MatchGroup and using function `matchWrapper`.

Signed-off-by: HE, Tao <sighingnow@gmail.com>
Test Plan: make test TEST="T14773a T14773b"

Reviewers: bgamari, RyanGlScott, simonpj

Reviewed By: bgamari, simonpj

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14773

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

19 months agoMove Data.Functor.Contravariant from the contravariant package to base.
Andrew Martin [Fri, 2 Mar 2018 19:14:13 +0000 (14:14 -0500)] 
Move Data.Functor.Contravariant from the contravariant package to base.

Move Data.Functor.Contravariant from the contravariant package to base.
Since base is the bottom of the dependency hierarchy, several instances
have been removed. They will need to be added to the following packages:
transformers, StateVar, and possibly tagged. There may not actually have
been any types from tagged that previous had instanced provided by this
module though, since it may have only been used for Data.Proxy. Additionally,
all CPP has been removed. Derived Typeable instances have been removed
(since Typeable is now automatically derived for everything). The language
extension Safe is still used, although it is unclear to ATM whether or not
it is necessary.

This resolves trac issue #14767.

Test Plan: validate

Reviewers: RyanGlScott, ekmett, hvr, bgamari

Reviewed By: RyanGlScott

Subscribers: rwbarton, thomie, ekmett, carter, RyanGlScott

GHC Trac Issues: #14767

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

19 months agoMake cost centre symbol names deterministic.
Shea Levy [Fri, 2 Mar 2018 17:59:06 +0000 (12:59 -0500)] 
Make cost centre symbol names deterministic.

Previously, non-CAF cost centre symbol names contained a unique,
leading to non-deterministic object files which, among other issues,
can lead to an inconsistency causing linking failure when using cached
builds sourced from multiple machines, such as with nix. Now, each
cost centre symbol is annotated with the type of cost centre it
is (CAF, expression annotation, declaration annotation, or HPC) and,
when a single module has multiple cost centres with the same name and
type, a 0-based index.

Reviewers: bgamari, simonmar

Reviewed By: bgamari

Subscribers: niteria, simonmar, RyanGlScott, osa1, rwbarton, thomie, carter

GHC Trac Issues: #4012, #12935

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

19 months agoOnly load plugins once
Matthew Pickering [Fri, 2 Mar 2018 18:45:47 +0000 (18:45 +0000)] 
Only load plugins once

Summary: This is part of D4342 which is worthwhile to merge on its own.

Reviewers: nboldi, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

Co-authored-by: Boldizsar Nemeth <nboldi@elte.hu>
19 months agorts: Note functions which must take all_tasks_mutex.
Ben Gamari [Fri, 2 Mar 2018 16:13:14 +0000 (11:13 -0500)] 
rts: Note functions which must take all_tasks_mutex.

19 months agoforkProcess: fix task mutex release order
Ömer Sinan Ağacan [Fri, 2 Mar 2018 16:15:03 +0000 (11:15 -0500)] 
forkProcess: fix task mutex release order

`all_tasks_mutex` should be released before calling `releaseCapability_`
in the parent process as `releaseCapability_` spawns worker tasks in
some cases.

Reviewers: bgamari, erikd, simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14538

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

19 months agoCache the fingerprint of sOpt_P
Bartosz Nitka [Thu, 22 Feb 2018 14:44:59 +0000 (06:44 -0800)] 
Cache the fingerprint of sOpt_P

Before this change we would compute a hash of
all the command line -optP flags once per file.
With a lot of files and many -optP flags, that's a lot
of repeated work.

I added a new Note that explains the approach and rationale.

Test Plan: new test

Reviewers: simonmar, simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14697

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

19 months agoRevert "Better stats for T5837"
Ben Gamari [Thu, 1 Mar 2018 19:06:04 +0000 (14:06 -0500)] 
Revert "Better stats for T5837"

This reverts commit d675a354e8db67d87d1f257c3d1d2bf2d58c2b3f.

19 months agoBuild quick flavor and run some tests on Windows
mrkkrp [Fri, 16 Feb 2018 11:53:31 +0000 (18:53 +0700)] 
Build quick flavor and run some tests on Windows

This build fits into the 90 minutes window.

19 months agoFix test for Trac #13075
Simon Peyton Jones [Tue, 27 Feb 2018 08:53:10 +0000 (08:53 +0000)] 
Fix test for Trac #13075

I'd put the stderr file in my link tree, not in the source tree,
so my original push had the wrong file, even though my tree
validated.  Sorry!

19 months agoComments only
Simon Peyton Jones [Tue, 27 Feb 2018 08:51:06 +0000 (08:51 +0000)] 
Comments only

19 months agoTest for Trac #13075 is working now
Simon Peyton Jones [Tue, 27 Feb 2018 08:46:50 +0000 (08:46 +0000)] 
Test for Trac #13075 is working now

19 months agoBetter stats for T5837
Simon Peyton Jones [Tue, 27 Feb 2018 08:43:51 +0000 (08:43 +0000)] 
Better stats for T5837

I'm not sure why. It's an odd test, mind you; a weird type-function
recursion thing.  So I'm not inclined to investigate.

Anyway, good!

19 months agoFix a nasty bug in the pure unifier
Simon Peyton Jones [Mon, 26 Feb 2018 17:44:55 +0000 (17:44 +0000)] 
Fix a nasty bug in the pure unifier

The pure unifier was building an infinite type, through a defective
occurs check.  So GHC went into an infinite loop.

Reason: we were neglecting the 'kco' part of the type, which
'unify_ty' maintains.  Yikes.

The fix is easy.  I refactored a bit to make it harder to
go wrong in future.

19 months agoComments only
Simon Peyton Jones [Tue, 20 Feb 2018 11:34:45 +0000 (11:34 +0000)] 
Comments only

19 months agoTiny refactor in Core Lint
Simon Peyton Jones [Tue, 20 Feb 2018 10:45:21 +0000 (10:45 +0000)] 
Tiny refactor in Core Lint

19 months agocircleci: Simplify Hadrian build
Ben Gamari [Mon, 26 Feb 2018 16:37:44 +0000 (11:37 -0500)] 
circleci: Simplify Hadrian build

This uses the build.sh script included in the Hadrian tree, ensuring that we
will build Cabal from git if necessary.

19 months agoUpdate .gitignore
Ömer Sinan Ağacan [Mon, 26 Feb 2018 06:04:13 +0000 (09:04 +0300)] 
Update .gitignore

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agotestsuite: Bump allocations for T9630
Ben Gamari [Sun, 25 Feb 2018 21:23:39 +0000 (16:23 -0500)] 
testsuite: Bump allocations for T9630

19 months agoboot: Create GNUmakefiles for libraries
Ben Gamari [Wed, 21 Feb 2018 14:58:19 +0000 (09:58 -0500)] 
boot: Create GNUmakefiles for libraries

D3918 neglected to implement this when it rewrote boot in python.

19 months agoIntroduce the flag -dsuppress-timestamps to avoid timestamps in dumps.
Andreas Klebinger [Tue, 20 Feb 2018 18:19:19 +0000 (13:19 -0500)] 
Introduce the flag -dsuppress-timestamps to avoid timestamps in dumps.

This makes it easier to diff dumps which are otherwise identical.

Also updated the description of -dsuppress-all as parts of these also
apply to stages other than core.

Test Plan: Looking at dump result.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

19 months agoRTS: Remove unused retainer schemes
Simon Jakobi [Tue, 20 Feb 2018 18:18:52 +0000 (13:18 -0500)] 
RTS: Remove unused retainer schemes

Reviewers: bgamari, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #11777

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

19 months agoRTS: Remember to free some pointers
Simon Jakobi [Tue, 20 Feb 2018 18:17:50 +0000 (13:17 -0500)] 
RTS: Remember to free some pointers

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari, simonmar

Subscribers: Phyx, rwbarton, thomie, carter

GHC Trac Issues: #11777

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

19 months agodriver/utils/dynwrapper.c: Remove unused variable
Simon Jakobi [Tue, 20 Feb 2018 18:17:27 +0000 (13:17 -0500)] 
driver/utils/dynwrapper.c: Remove unused variable

The variable was already unused when the file was introduced in
b35a6ce0e34255d200ddcf341ffc645fd237ea32.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #11777

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

19 months agoUpdate Hadrian submodule
Andrey Mokhov [Sat, 24 Feb 2018 15:00:22 +0000 (15:00 +0000)] 
Update Hadrian submodule

  * Make shell.nix less broken (hadrian/510)
  * Add --configure flag to the script
  * Undo iserv changes (hadrian/507)
  * Fix ghc-cabal: Parsec modules are now found in libraries/parsec/src (hadrian/506)
  * Move a bunch of types into dedicated modules (hadrian/502)
  * Add --quickjump to Haddock (hadrian/505)
  * Add iserv library (hadrian/504)
  * Merge pull request hadrian/503 from snowleopard/angerman-patch-1
  * Merge pull request hadrian/500 from snowleopard/runtime-deps
  * Fix Hadrian after Cabal changes (hadrian/498)
  * Drop custom logic for Scav_thr and Evac_thr (hadrian/497)
  * Fix Haddock (hadrian/496)

19 months agoComments in Unify, fixing #12442
Richard Eisenberg [Thu, 22 Feb 2018 15:44:18 +0000 (10:44 -0500)] 
Comments in Unify, fixing #12442

[ci skip]

19 months agoDon't use ld.gold when building libraries for GHCi
Simon Marlow [Wed, 21 Feb 2018 14:16:00 +0000 (14:16 +0000)] 
Don't use ld.gold when building libraries for GHCi

Summary:
ld.gold is buggy when using -r and a linker script.  See upstream bug
https://sourceware.org/bugzilla/show_bug.cgi?id=22266

This has been causing various brokenness for the GHC runtime linker,
where we load these broken object files.

Test Plan: Test program from #14675

Reviewers: bgamari, RyanGlScott, alpmestan, hvr, erikd

Subscribers: rwbarton, thomie, erikd, carter

GHC Trac Issues: #14328, #14675, #14291

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

20 months agoAdd references to #6087
Ömer Sinan Ağacan [Wed, 21 Feb 2018 06:47:13 +0000 (09:47 +0300)] 
Add references to #6087

[skip ci]

20 months agoRevert "Move `iserv` into `utils` and change package name
Ben Gamari [Tue, 20 Feb 2018 05:26:45 +0000 (00:26 -0500)] 
Revert "Move `iserv` into `utils` and change package name

See Phab:D4377 for the rationale. We will try this again.

This reverts commit 7c173b9043f7a9a5da46c5b0cc5fc3b38d1a7019.

20 months agoSlight refactor of stock deriving internals
Ryan Scott [Tue, 20 Feb 2018 17:50:34 +0000 (12:50 -0500)] 
Slight refactor of stock deriving internals

Summary:
Before, the `hasStockDeriving` function, which determines
how derived bindings should be generated for stock classes, was
awkwardly separated from the `checkSideConditions` function, which
checks invariants of the same classes that `hasStockDeriving` does.
As a result, there was a fair deal of hoopla needed to actually use
`hasStockDeriving`.

But this hoopla really isn't required—we should be using
`hasStockDeriving` from within `checkSideConditions`, since they're
looking up information about the same classes! By doing this, we can
eliminate some kludgy code in the form of `mk_eqn_stock'`, which had
an unreachable `pprPanic` that was stinking up the place.

Reviewers: bgamari, dfeuer

Reviewed By: bgamari

Subscribers: dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #13154

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

20 months agoAdd ghc-prim.buildinfo to .gitignore
Ryan Scott [Tue, 20 Feb 2018 17:49:19 +0000 (12:49 -0500)] 
Add ghc-prim.buildinfo to .gitignore

20 months agocircleci: Skip performance tests
Ben Gamari [Tue, 20 Feb 2018 05:26:45 +0000 (00:26 -0500)] 
circleci: Skip performance tests

Once we finally get the automation for #12758 we can re-enable these.

20 months agoDocument missing dataToTag# . tagToEnum# rule
David Feuer [Tue, 20 Feb 2018 04:48:22 +0000 (23:48 -0500)] 
Document missing dataToTag# . tagToEnum# rule

Explain why we don't have a rule to optimize `dataToTag# (tagToEnum# x)`
to `x`.

[skip ci]

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14282

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

20 months agoChange how includes for input file directory works
Tamar Christina [Tue, 20 Feb 2018 03:13:46 +0000 (22:13 -0500)] 
Change how includes for input file directory works

GHC Used to only allow for one include mode, namely `-I`.  The problem
with `-I` includes is that it supercedes all other includes, including
the system include paths.

This is not a problem for paths requested by the user, but it is a
problem for the ones we implicitly derive and add.

In particular we add the source directory of the input file to the
include path. This is problematic because it causes any file with the
name of a system include, to inadvertently loop as the wrong file gets
included.

Since this is an implicitly include, and as far as I can tell, only done
so local includes are found (as the sources given to GCC reside in a
temp folder) then switch from `-I` to `-iquote`.

This requires a submodule update for haddock

Test Plan: ./validate

Reviewers: austin, bgamari, hvr

Reviewed By: bgamari

Subscribers: carter, rwbarton, thomie

GHC Trac Issues: #14312

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

20 months agotestsuite: Bump allocations for T1969 and T5837
Ben Gamari [Tue, 20 Feb 2018 00:36:22 +0000 (19:36 -0500)] 
testsuite: Bump allocations for T1969 and T5837

Sadly it's not immediately obvious where this regression came from:

 * T5837 started failing on OS X with 0c2350c293b82e4cb24a66e00b904933bdb1c8f3
 * It's not clear when T1969 started failing due to the recent out of memory
   issues on Harbormaster

20 months agoBump text submodule to 1.2.3.0
Ben Gamari [Sun, 18 Feb 2018 16:31:41 +0000 (11:31 -0500)] 
Bump text submodule to 1.2.3.0

20 months agoBump haskeline submodule to 0.7.4.2
Ben Gamari [Sun, 18 Feb 2018 16:29:56 +0000 (11:29 -0500)] 
Bump haskeline submodule to 0.7.4.2

20 months agoBump parsec submodule to 0.3.13.0
Ben Gamari [Thu, 15 Feb 2018 16:43:35 +0000 (11:43 -0500)] 
Bump parsec submodule to 0.3.13.0

20 months agoBump primitive submodule to 0.6.3.0
Ben Gamari [Thu, 15 Feb 2018 16:42:35 +0000 (11:42 -0500)] 
Bump primitive submodule to 0.6.3.0

20 months agoBump stm submodule to 2.4.5.0
Ben Gamari [Sat, 3 Feb 2018 21:23:05 +0000 (16:23 -0500)] 
Bump stm submodule to 2.4.5.0

20 months agoBump pretty submodule
Ben Gamari [Mon, 29 Jan 2018 06:28:13 +0000 (01:28 -0500)] 
Bump pretty submodule

20 months agoBump filepath submodule
Ben Gamari [Tue, 23 Jan 2018 06:09:52 +0000 (01:09 -0500)] 
Bump filepath submodule

20 months agoBump process submodule
Ben Gamari [Tue, 23 Jan 2018 06:09:34 +0000 (01:09 -0500)] 
Bump process submodule

20 months agoBump haddock submodule again
Ben Gamari [Sun, 18 Feb 2018 17:02:44 +0000 (12:02 -0500)] 
Bump haddock submodule again

20 months agoIncrease the amount of parallelism in circleci.
Facundo Domínguez [Fri, 16 Feb 2018 11:18:52 +0000 (08:18 -0300)] 
Increase the amount of parallelism in circleci.

Summary: Set THREADS=CPUS+1 in circleci.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

20 months agoRename the types in a GADT constructor in toposorted order
Ryan Scott [Sun, 18 Feb 2018 16:14:26 +0000 (11:14 -0500)] 
Rename the types in a GADT constructor in toposorted order

Previously, we were extracting the free variables from a
GADT constructor in an incorrect order, which caused the type
variables for the constructor's type signature to end up in
non-toposorted order. Thankfully, rearranging the order of types
during renaming makes swift work of this bug.

This fixes a regression introduced in commit
fa29df02a1b0b926afb2525a258172dcbf0ea460.
For whatever reason, that commit also commented out a
significant portion of the `T13123` test. This code appears
to work, so I've opted to uncomment it.

Test Plan: make test TEST=T14808

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14808

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

20 months agoStgLint overhaul
Ömer Sinan Ağacan [Sun, 18 Feb 2018 16:12:53 +0000 (11:12 -0500)] 
StgLint overhaul

- Remove all type checks
- Check two STG invariants (no unboxed let bindings, variables defined
  before used) and post-unarisation invariants.

See the module header and #14787.

This version validates with `-dstg-lint` added to `GhcStage2HcOpts` and
`GhcLibHcOpts` and `EXTRA_HC_OPTS`.

Unarise changes:

- `unariseConArgBinder` and `unariseFunArgBinder` functions were almost
  the same; only difference was when unarising fun args we keep void
  args while in con args we drop them. A new function `unariseArgBinder`
  added with a `Bool` argument for whether we're unarising a con arg.
  `unariseConArgBinder` and `unariseFunArgBinder` are now defined as

      unariseConArgBinder = unarsieArgBinder True  -- data con
      unariseFunArgBinder = unariseArgBinder False -- not data con

- A bug in `unariseConArgBinder` and `unariseFunArgBinder` (which are
  just calls to `unariseArgBinder` now) that invalidated the
  post-unarise invariants when the argument has single type rep (i.e.
  `length (typePrimRep x) == 1`) fixed. This isn't a correctness issue
  (it's fine not to unarise if a variable is already represented as
  single value), but it triggers StgLint.

Test Plan:
- Pass testsuite with `-dstg-lint` [done]
- Boot stage2 (including libraries) with `-dstg-lint` [done]

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: duog, rwbarton, thomie, carter

GHC Trac Issues: #14787

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

20 months agoImprove error message for UNPACK/strictness annotations.
HE, Tao [Sun, 18 Feb 2018 16:10:37 +0000 (11:10 -0500)] 
Improve error message for UNPACK/strictness annotations.

Print different error message for improper UNPACK and strictness
annotations.  Fix Trac #14761.

Signed-off-by: HE, Tao <sighingnow@gmail.com>
Test Plan: make test TEST="T7210 T14761a T14761b"

Reviewers: goldfire, bgamari, RyanGlScott, simonpj

Reviewed By: RyanGlScott, simonpj

Subscribers: simonpj, goldfire, rwbarton, thomie, carter

GHC Trac Issues: #14761

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

20 months agotestsuite: Add newline to test output
Douglas Wilson [Sun, 18 Feb 2018 16:10:21 +0000 (11:10 -0500)] 
testsuite: Add newline to test output

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

20 months agoCBE: re-introduce bgamari's fixes
Michal Terepeta [Sun, 18 Feb 2018 16:09:40 +0000 (11:09 -0500)] 
CBE: re-introduce bgamari's fixes

During some recent work on CBE we discovered that `zipWith` is used to
check for equality, but that doesn't quite work if lists are of
different lengths! This was fixed by bgamari, but unfortunately the fix
had to be rolled back due to other changes in CBE in
50adbd7c5fe5894d3e6e2a58b353ed07e5f8949d. Since I wanted to have another
look at CBE anyway, we agreed that the first thing to do would be to
re-introduce the fix.

Sadly I don't have any actual test case that would exercise this.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: ./validate

Reviewers: bgamari, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14226

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

20 months agomyThreadId# is trivial; make it an inline primop
Simon Marlow [Sun, 18 Feb 2018 16:09:19 +0000 (11:09 -0500)] 
myThreadId# is trivial; make it an inline primop

The pattern `threadCapability =<< myThreadId` is used a lot in code
that uses `hs_try_putmvar`, I want to make it cheaper.

Test Plan: validate

Reviewers: bgamari, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

20 months agoTidy up and consolidate canned CmmReg and CmmGlobals
Simon Marlow [Sun, 18 Feb 2018 16:08:52 +0000 (11:08 -0500)] 
Tidy up and consolidate canned CmmReg and CmmGlobals

Test Plan: validate

Reviewers: bgamari, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

20 months agoRemove doubled words
Adam Sandberg Eriksson [Sun, 18 Feb 2018 16:08:31 +0000 (11:08 -0500)] 
Remove doubled words

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

20 months agoBuild Haddocks with --quickjump
Ben Gamari [Sun, 18 Feb 2018 16:01:59 +0000 (11:01 -0500)] 
Build Haddocks with --quickjump

By request of @alexbiehl.
CCing @snowleopard and @alpmestan as the same should be done in Hadrian.

Bumps haddock submodule.

Reviewers: alexbiehl

Reviewed By: alexbiehl

Subscribers: rwbarton, thomie, carter, snowleopard, alpmestan, alexbiehl

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

20 months agoAdd valid refinement substitution suggestions for typed holes
Matthías Páll Gissurarson [Sun, 18 Feb 2018 16:01:06 +0000 (11:01 -0500)] 
Add valid refinement substitution suggestions for typed holes

This adds valid refinement substitution suggestions for typed holes and
documentation thereof.

Inspired by Agda's refinement facilities, this extends the typed holes
feature to be able to search for valid refinement substitutions, which
are substitutions that have one or more holes in them.

When the flag `-frefinement-level-substitutions=n` where `n > 0` is
passed, we also look for valid refinement substitutions, i.e.
substitutions that are valid, but adds more holes. Consider the
following:

  f :: [Integer] -> Integer
  f = _

Here the valid substitutions suggested will be (with the new
`-funclutter-valid-substitutions` flag for less verbosity set):

```
  Valid substitutions include
    f :: [Integer] -> Integer
    product :: forall (t :: * -> *).
              Foldable t => forall a. Num a => t a -> a
    sum :: forall (t :: * -> *).
          Foldable t => forall a. Num a => t a -> a
    maximum :: forall (t :: * -> *).
              Foldable t => forall a. Ord a => t a -> a
    minimum :: forall (t :: * -> *).
              Foldable t => forall a. Ord a => t a -> a
    head :: forall a. [a] -> a
    (Some substitutions suppressed; use -fmax-valid-substitutions=N or
-fno-max-valid-substitutions)
```

When the `-frefinement-level-substitutions=1` flag is given, we
additionally compute and report valid refinement substitutions:

```
  Valid refinement substitutions include
    foldl1 _ :: forall (t :: * -> *).
                Foldable t => forall a. (a -> a -> a) -> t a -> a
    foldr1 _ :: forall (t :: * -> *).
                Foldable t => forall a. (a -> a -> a) -> t a -> a
    head _ :: forall a. [a] -> a
    last _ :: forall a. [a] -> a
    error _ :: forall (a :: TYPE r).
                GHC.Stack.Types.HasCallStack => [Char] -> a
    errorWithoutStackTrace _ :: forall (a :: TYPE r). [Char] -> a
    (Some refinement substitutions suppressed; use
-fmax-refinement-substitutions=N or -fno-max-refinement-substitutions)
```

Which are substitutions with holes in them. This allows e.g. beginners
to discover the fold functions and similar.

We find these refinement suggestions by considering substitutions that
don't fit the type of the hole, but ones that would fit if given an
additional argument. We do this by creating a new type variable with
newOpenFlexiTyVarTy (e.g. `t_a1/m[tau:1]`), and then considering
substitutions of the type `t_a1/m[tau:1] -> v` where `v` is the type of
the hole. Since the simplifier is free to unify this new type variable
with any type (and it is cloned before each check to avoid
side-effects), we can now discover any identifiers that would fit if
given another identifier of a suitable type. This is then generalized
so that we can consider any number of additional arguments by setting
the `-frefinement-level-substitutions` flag to any number, and then
considering substitutions like e.g. `foldl _ _` with two additional
arguments.

This can e.g. help beginners discover the `fold` functions.
This could also help more advanced users figure out which morphisms
they can use when arrow chasing.
Then you could write `m = _ . m2 . m3` where `m2` and `m3` are some
morphisms, and not only get exact fits, but also help in finding
morphisms that might get you a little bit closer to where you want to
go in the diagram.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

20 months agoImplement stopgap solution for #14728
Ryan Scott [Sun, 18 Feb 2018 16:00:40 +0000 (11:00 -0500)] 
Implement stopgap solution for #14728

It turns out that one can produce ill-formed Core by
combining `GeneralizedNewtypeDeriving`, `TypeInType`, and
`TypeFamilies`, as demonstrated in #14728. The root of the problem
is allowing the last parameter of a class to appear in a //kind// of
an associated type family, as our current approach to deriving
associated type family instances simply doesn't work well for that
situation.

Although it might be possible to properly implement this feature
today (see https://ghc.haskell.org/trac/ghc/ticket/14728#comment:3
for a sketch of how this might work), there does not currently exist
a performant implementation of the algorithm needed to accomplish
this. Until such an implementation surfaces, we will make this corner
case of `GeneralizedNewtypeDeriving` an error.

Test Plan: make test TEST="T14728a T14728b"

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14728

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

20 months agobase: Fix changelog entry for openTempFile
Ben Gamari [Thu, 15 Feb 2018 18:01:09 +0000 (13:01 -0500)] 
base: Fix changelog entry for openTempFile

This change is present in 4.11.0.0.