| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change it is possible to reconstruct the timing portion of a
`.prof` file after the fact. By logging the stacks at each time point
a more precise executation trace of the program can be observed rather
than all identical cost centres being identified in the report.
There are two new events:
1. `EVENT_PROF_BEGIN` - emitted at the start of profiling to communicate
the tick interval
2. `EVENT_PROF_SAMPLE_COST_CENTRE` - emitted on each tick to communicate the
current call stack.
Fixes #17322
|
|
|
|
|
| |
It may not exist if the source tarball was extracted yet not the
testsuite tarball.
|
|
|
|
|
|
|
| |
Function createIOThread expects its second argument to be of size word.
The natural size of the second parameter is 32bits. Thus for some 64bit
architectures, where a write of the lower half of a register does not
clear the upper half, the value must be zero extended.
|
|
|
|
| |
Zeros heap memory after gc freed it.
|
| |
|
|
|
|
|
| |
Previously we would throw an error which seems a bit harsh. As reported
in #17283.
|
|
|
|
|
|
|
| |
This modifies both the Hadrian and make build systems to avoid included
the rts.cabal generated by autoconf in the source distribution.
Fixes #17265.
|
|
|
|
| |
See #16205.
|
|
|
|
| |
This makes it match the others
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch also changes the way we handle empty lists, simplifying
them somewhat. See Note [Empty lists]. Previously, we had to
special-case empty lists in the type-checker. Now no more!
Finally, this patch improves some documentation around the ir_inst
field used in the type-checker.
This breaks a test case, but I really think the problem is #17251,
not really related to this patch.
Test case: typecheck/should_compile/T13680
|
|
|
|
| |
This is a good convenience for testing.
|
|
|
|
|
|
|
|
|
|
|
| |
Add a reference to the documentation for Data.List in the description
for String.
On the generated Haddock for Data.String,
http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-String.html
there is curently no hyperlink to Data.List, which is where a reader will find most of the useful functions which can operate on Strings. I imagine this has confused beginners who came to this page looking for String operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
allocateForCompact() is called when nursery of a compact region is
full, to add new blocks to the compact. New blocks added to an existing
region needs a StgCompactNFDataBlock header, not a StgCompactNFData.
This fixes allocateForCompact() so that it now correctly allocates space
for StgCompactNFDataBlock instead of StgCompactNFData as before.
Fixes #17044.
A regression test T17044 added.
|
|
|
|
|
|
|
|
|
|
| |
Previously, we would sometimes flatten 1-tuples and sometimes
not. This didn't cause damage because there is no way to
generate HsSyn with 1-tuples. But, with the upcoming fix to #16881,
there will be. Without this patch, obscure lint errors would
have resulted.
No test case, as there is not yet a way to tickle this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch:
* Implements a refactoring (suggested in
https://gitlab.haskell.org/ghc/ghc/merge_requests/1199#note_207345)
that moves all functions from `TcTypeableValidity` back to
`TcTypeable`, as the former module doesn't really need to live on its
own.
* Adds `Note [Typeable instances for casted types]` to `TcTypeable`
explaining why the `Typeable` solver currently does not support
types containing casts.
Resolves #16835.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simon writes:
Currently we check for a type arg rather than isTyCoArg. This in turn
makes INLINE things look bigger than they should be, and stops them
being inlined into boring contexts when they perfectly well could be.
E.g.
f x = g <refl> x
{-# INLINE g #-}
... (map (f x) xs) ...
The context is boring, so don't inline unconditionally. But f's RHS is
no bigger than its call, provided you realise that the coercion argument
is ultimately cost-free.
This happens in practice for $WHRefl. It's not a big deal: at most it
means we have an extra function call overhead. But it's untidy, and
actually worse than what happens without an INLINE pragma.
Fixes #17182
This makes 0.0% change in nofib binary sizes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* `mk_eqn_stock`, `mk_eqn_anyclass`, and `mk_eqn_no_mechanism` all
took a continuation of type
`DerivSpecMechanism -> DerivM EarlyDerivSpec` to represent its
primary control flow. However, in practice this continuation was
always instantiated with the `mk_originative_eqn` function, so
there's not much point in making this be a continuation in the
first place.
This patch removes these continuations in favor of invoking
`mk_originative_eqn` directly, which is simpler.
* There were several parts of `TcDeriv` that took different code
paths if compiling an `.hs-boot` file. But this is silly, because
ever since 101a8c770b9d3abd57ff289bffea3d838cf25c80 we simply error
eagerly whenever attempting to derive any instances in an
`.hs-boot` file.
This patch removes all of the unnecessary `.hs-boot` code paths,
leaving only one (which errors out).
* Remove various error continuation arguments from `mk_eqn_stock`
and related functions.
|
|
|
|
|
|
|
|
|
| |
In his paper "Warnings for Pattern Matching", Luke Maranget describes
three series in his appendix for which GHC's pattern match checker
scaled very badly. We mostly avoid this now with !1752. This commit adds
regression tests for each of the series.
Fixes #17264.
|
|
|
|
|
| |
Adds regression tests for tickets #17207, #17208, #17215, #17216,
#17218, #17219, #17248
|
|
|
|
| |
Marks process003 as fragile, as noted in #17245.
|
|
|
|
| |
See #17256.
|
|
|
|
|
| |
Use standalone kind signatures instead of complete user-specified kinds
in Data.Type.Equality and Data.Typeable
|
|
|
|
|
|
|
|
|
|
| |
Currently, there are no testcases for GHCi `:doc` command.
Perhaps because it was experimental. And it could be changed in the future.
But `:doc` command is already useful, so I add a minimal regression test
to keep current behavior.
See also 85309a3cda for implementation of `:doc` command.
|
| |
|
|
|
|
| |
This commit updates GHCi's help message for GHC 8.10.
|
|
|
|
|
|
|
|
|
|
|
| |
We were failing to correctly implement Note [Unbound RULE binders]
in Rules.hs. In particular, when cooking up a fake Refl,
were were failing to apply the substitition.
This patch fixes that problem, and simultaneously tidies
up the impedence mis-match between RuleSubst and TCvSubst.
Thanks to Sebastian!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit refactors interface file generation to allow information
from the later passed (NCG, STG) to be stored in interface files.
We achieve this by splitting interface file generation into two parts:
* Partial interfaces, built based on the result of the core pipeline
* A fully instantiated interface, which also contains the final
fingerprints and can optionally contain information produced by the backend.
This change is required by !1304 and !1530.
-dynamic-too handling is refactored too: previously when generating code
we'd branch on -dynamic-too *before* code generation, but now we do it
after.
(Original code written by @AndreasK in !1530)
Performance
~~~~~~~~~~~
Before this patch interface files where created and immediately flushed
to disk which made space leaks impossible.
With this change we instead use NFData to force all iface related data
structures to avoid space leaks.
In the process of refactoring it was discovered that the code in the
ToIface Module allocated a lot of thunks which were immediately forced
when writing/forcing the interface file. So we made this module more
strict to avoid creating many of those thunks.
Bottom line is that allocations go down by about ~0.1% compared to
master.
Residency is not meaningfully different after this patch.
Runtime was not benchmarked.
Co-Authored-By: Andreas Klebinger <klebinger.andreas@gmx.at>
Co-Authored-By: Ömer Sinan Ağacan <omer@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In #14998 I realised that the notion of speculative execution
*exactly matches* eager evaluation of expressions in a case alternative
where the scrutinee is an IO action.
Normally we have to `deferIO` any result from that single case
alternative to prevent this speculative execution, so we had a special
case in place in the demand analyser that would check if the scrutinee
was a prim-op, in which case we assumed that it would be ok to do the
eager evaluation.
Now we just check if the scrutinee is `exprOkForSpeculation`,
corresponding to the notion that we want to push evaluation of the
scrutinee *after* eagerly evaluating stuff from the case alternative.
This fixes #14988, because it resolves the last open Item 4 there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`pmcheck` used to call `refineToAltCon` which would refine the knowledge
we had about a variable by equating it to a `ConLike` application.
Since we weren't particularly smart about this in the Check module, we
simply freshened the constructors existential and term binders utimately
through a call to `mkOneConFull`.
But that instantiation is unnecessary for when we match against a
concrete pattern! The pattern will already have fresh binders and field
types. So we don't call `refineToAltCon` from `Check` anymore.
Subsequently, we can simplify a couple of call sites and functions in
`PmOracle`. Also implementing `computeCovered` becomes viable and we
don't have to live with the hack that was `addVarPatVecCt` anymore.
A side-effect of not indirectly calling `mkOneConFull` anymore is that
we don't generate the proper strict argument field constraints anymore.
Instead we now desugar ConPatOuts as if they had bangs on their strict
fields. This implies that `PmVar` now carries a `HsImplBang` that we
need to respect by a (somewhat ephemeral) non-void check. We fix #17234
in doing so.
|
|
|
|
|
| |
Due to #16087. This drops the previous explicit list of broken tests and rather
encompasses the entire set of tests since they all appear to be broken.
|
|
|
|
| |
As noted in #17256.
|
|
|
|
|
| |
Due to #16361. Note that I'm leaving out threaded2 since it's not clear
whether the single crash in that way was due to other causes.
|
|
|
|
| |
As noted in #17253.
|
|
|
|
|
| |
commit 795986aaf33e ("Remove unneeded CPP now that GHC 8.6 is the minimum")
broke the 8.4 build.
|
|
|
|
| |
As described in #17247.
|
| |
|
|
|
|
|
|
|
|
|
| |
Basically do what we currently only do for -XEmptyCase in other cases
where adding the type signature won't distract from pattern
matches in other positions.
We use the precedence to guide us, equating "need to parenthesise" with
"too much noise".
|
|
|
|
| |
mention of TypeError
|
| |
|
|
|
|
| |
As pointed out in #17243, `Type` is not the only kind
having values.
|
|
|
|
|
| |
`rts.conf` already contains this exact information in its
`extra-libraries` stanza.
|
|
|
|
|
|
| |
This fixes #16860 by verifying that the generated sources don't already
exist before asserting that the `alex` executable was found. This
replicates the logic already used for `happy` in the case of `alex`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unicode renders funny on my terminal and I like to avoid it where
possible. Most applications which print out non-ascii characters allow
users to disable such prints with an environment variable (e.g.
Homebrew).
This diff disables Unicode usage when the environment variable
`GHC_NO_UNICODE` is set. To test, set the env var and compile a bad
program. Note that GHC does not print Unicode bullets but instead prints
out asterisks:
```
$ GHC_NO_UNICODE= _build/stage1/bin/ghc ../Temp.hs
[1 of 1] Compiling Temp ( ../Temp.hs, ../Temp.o )
../Temp.hs:4:23: error:
* Couldn't match type `Bool' with `a -> Bool'
Expected type: Bool -> a -> Bool
Actual type: Bool -> Bool
* In the first argument of `foldl', namely `(&& (flip $ elem u))'
In the expression: foldl (&& (flip $ elem u)) True v
In an equation for `isPermut':
isPermut u v = foldl (&& (flip $ elem u)) True v
* Relevant bindings include
v :: [a] (bound at ../Temp.hs:4:12)
u :: [a] (bound at ../Temp.hs:4:10)
isPermut :: [a] -> [a] -> Bool (bound at ../Temp.hs:4:1)
|
4 | isPermut u v = foldl (&& (flip $ elem u)) True v
| ^^^^^^^^^^^^^^^^^^
```
(Broken code taken from Stack Overflow)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This resolves #16876 by making the explicit use of `-fbyte-code`
prevent code that enables `UnboxedTuples` or `UnboxedSums` from
automatically compiling to object code. This allows for a nice
middle ground where most code that enables `UnboxedTuples`/-`Sums`
will still benefit from automatically enabling `-fobject-code`, but
allows power users who wish to avoid this behavior in certain corner
cases (such as `lens`, whose use case is documented in #16876) to do
so.
Along the way, I did a little cleanup of the relevant code and
documentation:
* `enableCodeGenForUnboxedTuples` was only checking for the presence
of `UnboxedTuples`, but `UnboxedSums` has the same complications.
I fixed this and renamed the function to
`enableCodeGenForUnboxedTuplesOrSums`.
* I amended the users' guide with a discussion of these issues.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implements GHC Proposal #54: .../ghc-proposals/blob/master/proposals/0054-kind-signatures.rst
With this patch, a type constructor can now be given an explicit
standalone kind signature:
{-# LANGUAGE StandaloneKindSignatures #-}
type Functor :: (Type -> Type) -> Constraint
class Functor f where
fmap :: (a -> b) -> f a -> f b
This is a replacement for CUSKs (complete user-specified
kind signatures), which are now scheduled for deprecation.
User-facing changes
-------------------
* A new extension flag has been added, -XStandaloneKindSignatures, which
implies -XNoCUSKs.
* There is a new syntactic construct, a standalone kind signature:
type <name> :: <kind>
Declarations of data types, classes, data families, type families, and
type synonyms may be accompanied by a standalone kind signature.
* A standalone kind signature enables polymorphic recursion in types,
just like a function type signature enables polymorphic recursion in
terms. This obviates the need for CUSKs.
* TemplateHaskell AST has been extended with 'KiSigD' to represent
standalone kind signatures.
* GHCi :info command now prints the kind signature of type constructors:
ghci> :info Functor
type Functor :: (Type -> Type) -> Constraint
...
Limitations
-----------
* 'forall'-bound type variables of a standalone kind signature do not
scope over the declaration body, even if the -XScopedTypeVariables is
enabled. See #16635 and #16734.
* Wildcards are not allowed in standalone kind signatures, as partial
signatures do not allow for polymorphic recursion.
* Associated types may not be given an explicit standalone kind
signature. Instead, they are assumed to have a CUSK if the parent class
has a standalone kind signature and regardless of the -XCUSKs flag.
* Standalone kind signatures do not support multiple names at the moment:
type T1, T2 :: Type -> Type -- rejected
type T1 = Maybe
type T2 = Either String
See #16754.
* Creative use of equality constraints in standalone kind signatures may
lead to GHC panics:
type C :: forall (a :: Type) -> a ~ Int => Constraint
class C a where
f :: C a => a -> Int
See #16758.
Implementation notes
--------------------
* The heart of this patch is the 'kcDeclHeader' function, which is used to
kind-check a declaration header against its standalone kind signature.
It does so in two rounds:
1. check user-written binders
2. instantiate invisible binders a la 'checkExpectedKind'
* 'kcTyClGroup' now partitions declarations into declarations with a
standalone kind signature or a CUSK (kinded_decls) and declarations
without either (kindless_decls):
* 'kinded_decls' are kind-checked with 'checkInitialKinds'
* 'kindless_decls' are kind-checked with 'getInitialKinds'
* DerivInfo has been extended with a new field:
di_scoped_tvs :: ![(Name,TyVar)]
These variables must be added to the context in case the deriving clause
references tcTyConScopedTyVars. See #16731.
|
|
|
|
|
|
|
| |
The minimum required GHC version for bootstrapping is 8.6, so we can
get rid of some unneeded `#if `__GLASGOW_HASKELL__` CPP guards, as
well as one `MIN_VERSION_ghc_prim(0,5,3)` guard (since GHC 8.6 bundles
`ghc-prim-0.5.3`).
|