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

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`

 [1]: http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/23031

4 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

4 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

Summary:
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 <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, duncan, austin

Subscribers: thomie, carter, simonmar

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

4 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 <austin@well-typed.com>
4 years agoUpdate .mailmap
Thomas Miedema [Sat, 8 Nov 2014 12:44:57 +0000 (13:44 +0100)] 
Update .mailmap

[skip ci]

4 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: https://phabricator.haskell.org/D471

4 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

4 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

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

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

4 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

4 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

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

4 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
characteristics.

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: https://phabricator.haskell.org/D459

4 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: https://phabricator.haskell.org/D470

4 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: https://phabricator.haskell.org/D375

4 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: https://phabricator.haskell.org/D472

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

4 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
warnings.

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

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

4 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:
        0,
                         from includes/Stg.h:69,
                         from /tmp/ghc19488_0/ghc19488_2.hc:3:

    /usr/include/features.h:148: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 <slyfox@gentoo.org>
4 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.

4 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]

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

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

4 years agoTestsuite wibbles due to #9204
Richard Eisenberg [Fri, 7 Nov 2014 21:32:39 +0000 (16:32 -0500)] 
Testsuite wibbles due to #9204

4 years agoFix #9204 by outputting extra info on boot file mismatch.
Richard Eisenberg [Wed, 5 Nov 2014 15:52:57 +0000 (10:52 -0500)] 
Fix #9204 by outputting extra info on boot file mismatch.

[skip ci] -- testsuite wibbles are in next commit

4 years agoTest #9204 in roles/should_fail/T9204
Richard Eisenberg [Tue, 4 Nov 2014 22:40:06 +0000 (17:40 -0500)] 
Test #9204 in roles/should_fail/T9204

4 years agoFix #9064 by adding support for generic default signatures to TH.
Richard Eisenberg [Tue, 4 Nov 2014 21:38:22 +0000 (16:38 -0500)] 
Fix #9064 by adding support for generic default signatures to TH.

4 years agoTest #9064 in th/T9064
Richard Eisenberg [Tue, 4 Nov 2014 20:28:40 +0000 (15:28 -0500)] 
Test #9064 in th/T9064

4 years agoFix #8100, by adding StandaloneDerivD to TH's Dec type.
Richard Eisenberg [Tue, 4 Nov 2014 20:24:33 +0000 (15:24 -0500)] 
Fix #8100, by adding StandaloneDerivD to TH's Dec type.

4 years agoTest #8100 in th/T8100
Richard Eisenberg [Tue, 4 Nov 2014 20:15:56 +0000 (15:15 -0500)] 
Test #8100 in th/T8100

4 years agoDerive Generic for TH types (#9527)
Richard Eisenberg [Tue, 4 Nov 2014 18:21:57 +0000 (13:21 -0500)] 
Derive Generic for TH types (#9527)

4 years agoRemove unboxed Int# fields from NameFlavour (#9527)
Richard Eisenberg [Tue, 4 Nov 2014 18:03:48 +0000 (13:03 -0500)] 
Remove unboxed Int# fields from NameFlavour (#9527)

4 years agoUntabify template-haskell.
Richard Eisenberg [Tue, 4 Nov 2014 18:43:17 +0000 (13:43 -0500)] 
Untabify template-haskell.

4 years agoFix #9066.
Richard Eisenberg [Mon, 3 Nov 2014 16:15:35 +0000 (11:15 -0500)] 
Fix #9066.

When splicing in a fixity declaration, look for both term-level things
and type-level things. This requires some changes elsewhere in the
code to allow for more flexibility when looking up Exact names, which
can be assigned the wrong namespace during fixity declaration
conversion.

See the ticket for more info.

4 years agoTest #9066 in th/T9066
Richard Eisenberg [Sun, 2 Nov 2014 18:44:27 +0000 (13:44 -0500)] 
Test #9066 in th/T9066

4 years agofix allocLimit3 on Windows
Simon Marlow [Thu, 6 Nov 2014 16:42:49 +0000 (16:42 +0000)] 
fix allocLimit3 on Windows

4 years agoFix build errors on Windows (these tests still don't work though)
Simon Marlow [Wed, 5 Nov 2014 18:05:10 +0000 (18:05 +0000)] 
Fix build errors on Windows (these tests still don't work though)

4 years agoPer-thread allocation counters and limits
Simon Marlow [Tue, 14 Oct 2014 23:03:15 +0000 (00:03 +0100)] 
Per-thread allocation counters and limits

This reverts commit f0fcc41d755876a1b02d1c7c79f57515059f6417.

New changes: now works on 32-bit platforms too.  I added some basic
support for 64-bit subtraction and comparison operations to the x86
NCG.

4 years agoImplement new integer-gmp2 from scratch (re #9281)
Herbert Valerio Riedel [Sun, 19 Oct 2014 18:37:40 +0000 (20:37 +0200)] 
Implement new integer-gmp2 from scratch (re #9281)

This is done as a separate `integer-gmp2` backend library because it
turned out to become a complete rewrite from scratch.

Due to the different (over)allocation scheme and potentially different
accounting (via the new `{shrink,resize}MutableByteArray#` primitives),
some of the nofib benchmarks actually results in increased allocation
numbers (but not necessarily an increase in runtime!).  I believe the
allocation numbers could improve if `{resize,shrink}MutableByteArray#`
could be optimised to reallocate in-place more efficiently.

Here are the more apparent changes in the latest nofib comparision
between `integer-gmp` and `integer-gmp2`:

  ------------------------------------------------------------------
          Program     Size    Allocs   Runtime   Elapsed  TotalMem
  ------------------------------------------------------------------
              ...
       bernouilli    +1.6%    +15.3%     0.132     0.132      0.0%
              ...
     cryptarithm1    -2.2%      0.0%     -9.7%     -9.7%      0.0%
              ...
            fasta    -0.7%     -0.0%    +10.9%    +10.9%      0.0%
              ...
            kahan    +0.6%    +38.9%     0.169     0.169      0.0%
              ...
             lcss    -0.7%     -0.0%     -6.4%     -6.4%      0.0%
              ...
           mandel    +1.6%    +33.6%     0.049     0.049      0.0%
              ...
         pidigits    +0.8%     +8.5%     +3.9%     +3.9%      0.0%
            power    +1.4%    -23.8%    -18.6%    -18.6%    -16.7%
              ...
        primetest    +1.3%    +50.1%     0.085     0.085      0.0%
              ...
              rsa    +1.6%    +53.4%     0.026     0.026      0.0%
              ...
              scs    +1.2%     +6.6%     +6.5%     +6.6%    +14.3%
              ...
           symalg    +1.0%     +9.5%     0.010     0.010      0.0%
              ...
        transform    -0.6%     -0.0%     -5.9%     -5.9%      0.0%
              ...
  ------------------------------------------------------------------
              Min    -2.3%    -23.8%    -18.6%    -18.6%    -16.7%
              Max    +1.6%    +53.4%    +10.9%    +10.9%    +14.3%
   Geometric Mean    -0.3%     +1.9%     -0.8%     -0.8%     +0.0%

(see P35 / https://phabricator.haskell.org/P35 for full report)

By default, `INTEGER_LIBRARY=integer-gmp2` is active now, which results
in the package `integer-gmp-1.0.0.0` being registered in the package db.
The previous `integer-gmp-0.5.1.0` can be restored by setting
`INTEGER_LIBRARY=integer-gmp` (but will probably be removed altogether
for GHC 7.12). In-tree GMP support has been stolen from the old
`integer-gmp` (while unpatching the custom memory-allocators, as well as
forcing `-fPIC`)

A minor hack to `ghc-cabal` was necessary in order to support two different
`integer-gmp` packages (in different folders) with the same package key.

There will be a couple of follow-up commits re-implementing some features
that were dropped to keep D82 minimal, as well as further
clean-ups/improvements.

More information can be found via #9281 and
https://ghc.haskell.org/trac/ghc/wiki/Design/IntegerGmp2

Reviewed By: austin, rwbarton, simonmar

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

4 years agoDisable T4801/peak_megabytes_allocated
Herbert Valerio Riedel [Sun, 9 Nov 2014 20:54:43 +0000 (21:54 +0100)] 
Disable T4801/peak_megabytes_allocated

This test seems too close to a tipping point (and thus too sensitive to the
build-env used) and T4801's `max_bytes_used` was disabled as well some time
ago for a similiar reason.

4 years agoAdd stderr for T9662
Simon Peyton Jones [Tue, 11 Nov 2014 15:14:20 +0000 (15:14 +0000)] 
Add stderr for T9662

4 years agoTest Trac #7862
Simon Peyton Jones [Tue, 11 Nov 2014 13:06:21 +0000 (13:06 +0000)] 
Test Trac #7862

4 years agoTest Trac #9077
Simon Peyton Jones [Tue, 11 Nov 2014 11:46:52 +0000 (11:46 +0000)] 
Test Trac #9077

4 years agoImprove documentation of -ticky a little
Simon Peyton Jones [Tue, 11 Nov 2014 11:36:57 +0000 (11:36 +0000)] 
Improve documentation of -ticky a little

4 years agoComments only
Simon Peyton Jones [Tue, 11 Nov 2014 11:36:16 +0000 (11:36 +0000)] 
Comments only

4 years agoTest Trac #9662
Simon Peyton Jones [Tue, 11 Nov 2014 11:35:48 +0000 (11:35 +0000)] 
Test Trac #9662

4 years agoComments only (on recursive dictionaries)
Simon Peyton Jones [Tue, 11 Nov 2014 10:27:51 +0000 (10:27 +0000)] 
Comments only (on recursive dictionaries)

4 years agoDe-bias Data.Foldable and improve docstrings
David Feuer [Tue, 11 Nov 2014 07:35:37 +0000 (08:35 +0100)] 
De-bias Data.Foldable and improve docstrings

Use fewer left/right-biased folds for defaults and
functions in `Data.Foldable`, to better support things
that don't look like cons lists.

This also extends the Haddock docstrings in `Data.Foldable`.

Reviewed By: hvr, ekmett

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

4 years agoDefine list monad operations using comprehensions
David Feuer [Tue, 11 Nov 2014 06:59:34 +0000 (07:59 +0100)] 
Define list monad operations using comprehensions

Define list monad operations using list comprehensions. Code using monad
operations with lists did not fuse fully. Writing list code with `do`
notation or `(>>=)` and `(>>)` operations could allocate more than
equivalent code using list comprehensions.

Define `mapM` directly, instead of using `sequence` and `map`. This
leads to substantially less allocation in `cryptarithm2`.

Addresses #9781

Reviewed By: ekmett, nomeata

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

4 years agoTypo fix; Trac #9787
Austin Seipp [Mon, 10 Nov 2014 21:13:26 +0000 (15:13 -0600)] 
Typo fix; Trac #9787

Also, reword :print description.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoMove Data.Functor.Identity from transformers to base
Herbert Valerio Riedel [Sun, 5 Oct 2014 13:18:49 +0000 (15:18 +0200)] 
Move Data.Functor.Identity from transformers to base

This also updates the `transformers` submodule to the just
released `transformers-0.4.2.0` package version.

See #9664 for more details

Reviewed By: austin, ekmett

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

4 years agoUse (.) and id from Base in Control.Applicative
David Feuer [Sat, 8 Nov 2014 20:43:27 +0000 (21:43 +0100)] 
Use (.) and id from Base in Control.Applicative

Control.Applicative previously imported `(.)` and `id` from `Control.Arrow`,
but then only applied them to functions.

Reviewed By: ekmett, hvr

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

4 years agoUnlit overlooked GHC/Conc/Sync.lhs
Herbert Valerio Riedel [Sat, 8 Nov 2014 14:13:59 +0000 (15:13 +0100)] 
Unlit overlooked GHC/Conc/Sync.lhs

This is a follow-up commit to df3b1d43cc862fe03f0724a9c0ac9e7cecdf4605

4 years agoGroup PatSyn req/prov arguments together so that they're not all over the place
Dr. ERDI Gergo [Thu, 6 Nov 2014 11:01:38 +0000 (19:01 +0800)] 
Group PatSyn req/prov arguments together so that they're not all over the place

4 years agoIn pattern synonym matchers, support unboxed continuation results (fixes #9783).
Dr. ERDI Gergo [Sat, 8 Nov 2014 04:24:55 +0000 (12:24 +0800)] 
In pattern synonym matchers, support unboxed continuation results (fixes #9783).

This requires ensuring the continuations have arguments by adding a dummy
Void# argument when needed. This is so that matching on a pattern synonym
is lazy even when the result is unboxed, e.g.

    pattern P = ()
    f P = 0#

In this case, without dummy arguments, the generated matcher's type would be

   $mP :: forall (r :: ?). () -> r -> r -> r

which is called in `f` at type `() -> Int# -> Int# -> Int#`,
so it would be strict, in particular, in the failure continuation
of `patError`.

We work around this by making sure both continuations have arguments:

  $mP :: forall (r :: ?). () -> (Void# -> r) -> (Void# -> r) -> r

Of course, if `P` (and thus, the success continuation) has any arguments,
we are only adding the extra dummy argument to the failure continuation.

4 years agoTop-level comment for keepPackageImports.
Edward Z. Yang [Tue, 4 Nov 2014 21:05:13 +0000 (13:05 -0800)] 
Top-level comment for keepPackageImports.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoMiscellaneous documentation for the Finder.
Edward Z. Yang [Tue, 4 Nov 2014 10:07:01 +0000 (02:07 -0800)] 
Miscellaneous documentation for the Finder.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoTypofix.
Edward Z. Yang [Thu, 6 Nov 2014 23:04:03 +0000 (15:04 -0800)] 
Typofix.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoPreserve argument order to (==)/eq in nub and nubBy
Thomas Miedema [Fri, 7 Nov 2014 16:38:59 +0000 (17:38 +0100)] 
Preserve argument order to (==)/eq in nub and nubBy

This makes nub and nubBy behave as specified in the Haskell 98 Report.

This reverts 0ad9def53842e86fb292eccb810190711c42d7c5, and
fixes #3280, #7913 and #2528 (properly).

Before this change, the output of `T2528` was (4x wrong):
```
[A,B]
[1,2]
False
False
```

Reviewed By: dfeuer, ekmett, austin, hvr

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

4 years agobase: Manually unlit .lhs into .hs modules
Herbert Valerio Riedel [Fri, 7 Nov 2014 15:26:59 +0000 (16:26 +0100)] 
base: Manually unlit .lhs into .hs modules

This commit mostly converts literate comments into ordinary
Haskell comments or sometimes even Haddock comments, while also
removing literate comments in a few cases where they don't make
much sense anymore.

Moreover, in a few cases trailing whitespaces were removed as well.

Reviewed By: austin

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

4 years agoHave validate take into account stat test failures too.
Gintautas Miliauskas [Fri, 7 Nov 2014 16:17:03 +0000 (10:17 -0600)] 
Have validate take into account stat test failures too.

This should have gone in with the update in testlib.py to split
off stat test failures into a separate category in the summary.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoUse bracket in `withCurrentDirectory`
Konstantin Zudov [Fri, 7 Nov 2014 13:32:48 +0000 (07:32 -0600)] 
Use bracket in `withCurrentDirectory`

Summary: There was a comment about that. Seems like a better behaviour.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, simonmar

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

4 years ago[Docs] Fixed several broken urls in user's guide
Konstantin Zudov [Fri, 7 Nov 2014 13:32:35 +0000 (07:32 -0600)] 
[Docs] Fixed several broken urls in user's guide

Summary: Some of the links in user's guide were broken, I've found the files they used to link and updated urls.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, simonmar

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

4 years agosmall parser/lexer cleanup
Yuri de Wit [Fri, 7 Nov 2014 13:32:26 +0000 (07:32 -0600)] 
small parser/lexer cleanup

Summary:
The last three '#define ...' macros were removed from Parser.y.pp and this file was renamed to Parser.y.
This basically got rid of a CPP step in the build.

Also converted two modules in compiler/parser/ from .lhs to .hs.

Test Plan: Does it build? Yes, I performed a full build here and things are looking good.

Reviewers: austin

Reviewed By: austin

Subscribers: adamse, thomie, carter, simonmar

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

4 years ago*Really*, really fix RTS crash due to bad coercion.
Merijn Verstraaten [Fri, 7 Nov 2014 13:32:18 +0000 (07:32 -0600)] 
*Really*, really fix RTS crash due to bad coercion.

Summary:
My previous attempt to fix the new coercion bug introduced by my fix actually
just reverted back to the *old* bug. This time it should properly handle all
three size scenarios.

Signed-off-by: Merijn Verstraaten <merijn@inconsistent.nl>
Test Plan: validate

Reviewers: dfeuer, austin, hvr

Reviewed By: austin, hvr

Subscribers: thomie, carter, simonmar

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

GHC Trac Issues: #8089

4 years agoUpdate .gitignore to properly ignore emacs temp files
Austin Seipp [Fri, 7 Nov 2014 13:30:53 +0000 (07:30 -0600)] 
Update .gitignore to properly ignore emacs temp files

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoMake getTag use a bang pattern instead of seq
David Feuer [Fri, 7 Nov 2014 13:19:18 +0000 (14:19 +0100)] 
Make getTag use a bang pattern instead of seq

It's prettier that way, and there's less risk of anything
going sideways.

Reviewed By: hvr, simonpj

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

4 years agoImprove Applicative definitions
David Feuer [Fri, 7 Nov 2014 07:12:21 +0000 (08:12 +0100)] 
Improve Applicative definitions

Generally clean up things relating to Applicative and Monad in `GHC.Base`
and `Control.Applicative` to make `Applicative` feel like a bit more of a
first-class citizen rather than just playing second fiddle to `Monad`. Use
`coerce` and GND to improve performance and clarity.

Change the default definition of `(*>)` to use `(<$)`, in case the
`Functor` instance optimizes that.

Moreover, some manually written instances are made into compiler-derived
instances.

Finally, this also adds a few AMP-related laws to the `Applicative` docstring.

NOTE: These changes result in a 13% decrease in allocation for T9020

Reviewed By: ekmett, hvr

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

4 years agoWarn for Safe Haskell when -XOverlappingInstances or
David Terei [Mon, 4 Aug 2014 21:43:09 +0000 (17:43 -0400)] 
Warn for Safe Haskell when -XOverlappingInstances or
-XIncoherentInstances turned on.

4 years agoAdd in Incoherent Instances test for Safe Haskell.
David Terei [Mon, 4 Aug 2014 21:41:54 +0000 (17:41 -0400)] 
Add in Incoherent Instances test for Safe Haskell.

4 years agoBetter error messages for new per-instance overlap flags and Safe
David Terei [Mon, 4 Aug 2014 16:49:07 +0000 (12:49 -0400)] 
Better error messages for new per-instance overlap flags and Safe
Haskell.

4 years agoRe-enable T3064, which works now
Simon Peyton Jones [Thu, 6 Nov 2014 15:46:11 +0000 (15:46 +0000)] 
Re-enable T3064, which works now

4 years agoRefactor the code that prevents recursion among Coercible constraints
Simon Peyton Jones [Thu, 6 Nov 2014 15:41:50 +0000 (15:41 +0000)] 
Refactor the code that prevents recursion among Coercible constraints

The main description is in Note [Preventing recursive dictionaries]
in TcRnTypes, which applies only to Coercible dictionaries.

But it was a bit of a mess:
 - It wasn't applied consistently
 - It was being applied to non-Coercible dictionaries in some places

This patch tidies it up.

This hack will largely go away when Richard starts treating Coercible
constraints more like equalities than like dictionaries.

4 years agoWibbles to notes
Simon Peyton Jones [Thu, 6 Nov 2014 13:55:05 +0000 (13:55 +0000)] 
Wibbles to notes

4 years agoAllow the solved dictionaries to propagate from outside in
Simon Peyton Jones [Thu, 6 Nov 2014 13:54:20 +0000 (13:54 +0000)] 
Allow the solved dictionaries to propagate from outside in

See Note [Propagate solved dictionaries] in TcSMonad.  This
can signficantly reduce the number of solver steps.

4 years agoMinor refacoring and trace-message printing
Simon Peyton Jones [Thu, 6 Nov 2014 13:48:48 +0000 (13:48 +0000)] 
Minor refacoring and trace-message printing

4 years agoSwitch off lazy flattening (fix Trac #3064)
Simon Peyton Jones [Thu, 6 Nov 2014 13:46:47 +0000 (13:46 +0000)] 
Switch off lazy flattening (fix Trac #3064)

See Note [Lazy flattening] in TcFlatten.

Lazy flattening was an apparently good idea which actually made
the type inference engine go a LOTS slower in T3064.  So I switched
it off again.

4 years agoGive T3064 the right module name (just tidying up)
Simon Peyton Jones [Thu, 6 Nov 2014 13:35:09 +0000 (13:35 +0000)] 
Give T3064 the right module name (just tidying up)

4 years agoComments and white space only
Simon Peyton Jones [Thu, 6 Nov 2014 13:34:25 +0000 (13:34 +0000)] 
Comments and white space only

4 years agoMake tyConsOfType return a (NameEnv TyCon) rather than [TyCon]
Simon Peyton Jones [Thu, 6 Nov 2014 13:18:16 +0000 (13:18 +0000)] 
Make tyConsOfType return a (NameEnv TyCon) rather than [TyCon]

A little refactoring

4 years agoRemove unused tyConsOfDataCon
Simon Peyton Jones [Thu, 6 Nov 2014 13:16:20 +0000 (13:16 +0000)] 
Remove unused tyConsOfDataCon

4 years agoMove expansion of 'assert' from renamer to typechecker
Simon Peyton Jones [Thu, 6 Nov 2014 13:59:42 +0000 (13:59 +0000)] 
Move expansion of 'assert' from renamer to typechecker

This improves error messages when there is a type error,
fixing Trac #9774

4 years agoUpdate User's Guide, cleanup DynFlags
Jan Stolarek [Wed, 5 Nov 2014 12:44:32 +0000 (13:44 +0100)] 
Update User's Guide, cleanup DynFlags

4 years agoRemove -ddump-core-pipeline flag
Jan Stolarek [Wed, 5 Nov 2014 12:43:48 +0000 (13:43 +0100)] 
Remove -ddump-core-pipeline flag

4 years agoRemove -ddump-simpl-phases flag
Jan Stolarek [Wed, 5 Nov 2014 12:37:25 +0000 (13:37 +0100)] 
Remove -ddump-simpl-phases flag

4 years agoClarify confusing notice from `make maintainer-clean`
Jan Stolarek [Wed, 5 Nov 2014 08:39:50 +0000 (09:39 +0100)] 
Clarify confusing notice from `make maintainer-clean`

4 years agoAdd doctest examples for Data.Either
Michael Orlitzky [Thu, 6 Nov 2014 07:29:26 +0000 (08:29 +0100)] 
Add doctest examples for Data.Either

Add doctest examples for every data type and function in `Data.Either`

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

4 years agoAdd a comment about stack checks
Simon Marlow [Tue, 4 Nov 2014 21:32:26 +0000 (21:32 +0000)] 
Add a comment about stack checks

4 years agoDisable an assertion; see comment
Simon Marlow [Tue, 4 Nov 2014 21:32:12 +0000 (21:32 +0000)] 
Disable an assertion; see comment

4 years agoFix a couple of inaccurate stack checks
Simon Marlow [Tue, 4 Nov 2014 21:31:00 +0000 (21:31 +0000)] 
Fix a couple of inaccurate stack checks

4 years agoFix bugs in debug printing
Simon Marlow [Tue, 4 Nov 2014 15:52:23 +0000 (15:52 +0000)] 
Fix bugs in debug printing

4 years agoFix a couple of bugs in the way info tables are generated for 64-bit platforms
Simon Marlow [Tue, 4 Nov 2014 15:51:56 +0000 (15:51 +0000)] 
Fix a couple of bugs in the way info tables are generated for 64-bit platforms

1. The offset was a full word, but it should actually be a 32-bit
offset on 64-bit platforms.
2. The con_desc string was allocated separately, which meant that it
might be out of range for a 32-bit offset.

These bugs meant that +RTS -Di (interpreter debugging) would sometimes
crash on 64-bit.

4 years agoFix typo in testsuite Makefile
Herbert Valerio Riedel [Wed, 5 Nov 2014 13:05:48 +0000 (14:05 +0100)] 
Fix typo in testsuite Makefile

This is introduced in aa4799534225e3fc6bbde0d5e5eeab8868cc3111
and would cause indeterministic testsuite failures in `sigof02dmt`

4 years agoAdd `isSubsequenceOf` to Data.List (#9767)
Alexander Berntsen [Wed, 5 Nov 2014 11:32:06 +0000 (12:32 +0100)] 
Add `isSubsequenceOf` to Data.List (#9767)

Niklas Hamb├╝chen suggested that we add the dual of `subsequences`,
isSubsequenceOf (like `isPrefixOf` to `inits` & `isSuffixOf` to `tails`).
It was a simple and noncontroversial proposal which passed unanimously.

For more details see the original proposal discussion at
https://www.haskell.org/pipermail/libraries/2014-November/024063.html

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

Signed-off-by: Alexander Berntsen <alexander@plaimi.net>
4 years agoClean-up Haddock in `Data.Functor`
Herbert Valerio Riedel [Wed, 5 Nov 2014 11:19:13 +0000 (12:19 +0100)] 
Clean-up Haddock in `Data.Functor`

This mostly cleans up irregularities introduced in
68255588f89462e542c502f6f92548712808032f (re D352) as well as making
sure Haddock is able to resolve all references.

4 years agoRemove redundant contexts from Foldable methods
David Feuer [Wed, 5 Nov 2014 07:42:59 +0000 (08:42 +0100)] 
Remove redundant contexts from Foldable methods

New `Foldable` methods accidentally had `Foldable` contexts, which led
to type roles being assigned incorrectly and preventing GND from
deriving `Foldable` instances. Removing those fixes #9761.

Moreover, this patch takes advantage of this fix by deriving
`Foldable` (and `Eq`) for `UniqFM`.

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

4 years agoTemporarily disable T3064 (see #9771)
Herbert Valerio Riedel [Wed, 5 Nov 2014 07:39:10 +0000 (08:39 +0100)] 
Temporarily disable T3064 (see #9771)

This disables T3064 temporarily as it puts a strain on buildbots
during validation exhausting all available memory.