summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Do not rely on CUSKs in 'base'wip/libraries-no-cusksVladislav Zavialov2019-09-282-3/+8
| | | | | Use standalone kind signatures instead of complete user-specified kinds in Data.Type.Equality and Data.Typeable
* testsuite: Mark TH tests as fragile in LLVM built external-interpreterBen Gamari2019-09-271-9/+4
| | | | | 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.
* testsuite: Mark T3389 as broken in profiled ways on i386Ben Gamari2019-09-271-1/+2
| | | | As noted in #17256.
* testsuite: Mark hs_try_putmvar003 as fragile in threaded1Ben Gamari2019-09-271-1/+2
| | | | | 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.
* testsuite: Mark compact_gc as fragile in the ghci wayBen Gamari2019-09-271-1/+1
| | | | As noted in #17253.
* Raise minimum GHC version to 8.6Daniel Gröber2019-09-271-2/+2
| | | | | commit 795986aaf33e ("Remove unneeded CPP now that GHC 8.6 is the minimum") broke the 8.4 build.
* testsuite: Mark cgrun071 as broken on i386Ben Gamari2019-09-271-1/+4
| | | | As described in #17247.
* Add test for expected dependencies of 'Parser'Shayne Fletcher2019-09-272-0/+65
|
* PmCheck: Look at precendence to give type signatures to some wildcardsSebastian Graf2019-09-2718-65/+85
| | | | | | | | | 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".
* Expand description of DataKinds to mention data constructors, and include ↵chris-martin2019-09-271-3/+8
| | | | mention of TypeError
* Clarify the purpose and status of the GHC.TypeLits modulechris-martin2019-09-271-3/+9
|
* ghc-prim: Fix documentation of TypeBen Gamari2019-09-271-1/+1
| | | | As pointed out in #17243, `Type` is not the only kind having values.
* Just get RTS libs from its package confJohn Ericson2019-09-271-19/+0
| | | | | `rts.conf` already contains this exact information in its `extra-libraries` stanza.
* configure: Don't depend upon alex in source dist buildBen Gamari2019-09-271-2/+5
| | | | | | 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`.
* Allow users to disable Unicode with an env varRon Mordechai2019-09-272-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* PmCheck: Elaborate what 'model' means in the user guide [skip ci]Sebastian Graf2019-09-271-8/+14
|
* Make -fbyte-code prevent unboxed tuples/sums from implying object code (#16876)Ryan Scott2019-09-269-16/+71
| | | | | | | | | | | | | | | | | | | | 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.
* Standalone kind signatures (#16794)wip/top-level-kind-signaturesVladislav Zavialov2019-09-25244-585/+3148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unneeded CPP now that GHC 8.6 is the minimumRyan Scott2019-09-254-27/+0
| | | | | | | 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`).
* base: Move Ix typeclass to GHC.IxBen Gamari2019-09-2513-358/+383
| | | | | The `Ix` class seems rather orthogonal to its original home in `GHC.Arr`.
* PmCheck: Only ever check constantly many models against a single patternSebastian Graf2019-09-2516-274/+278
| | | | | | | | | | | | | | | | | | | | | | | | | Introduces a new flag `-fmax-pmcheck-deltas` to achieve that. Deprecates the old `-fmax-pmcheck-iter` mechanism in favor of this new flag. From the user's guide: Pattern match checking can be exponential in some cases. This limit makes sure we scale polynomially in the number of patterns, by forgetting refined information gained from a partially successful match. For example, when matching `x` against `Just 4`, we split each incoming matching model into two sub-models: One where `x` is not `Nothing` and one where `x` is `Just y` but `y` is not `4`. When the number of incoming models exceeds the limit, we continue checking the next clause with the original, unrefined model. This also retires the incredibly hard to understand "maximum number of refinements" mechanism, because the current mechanism is more general and should catch the same exponential cases like PrelRules at the same time. ------------------------- Metric Decrease: T11822 -------------------------
* includes/CodeGen.Platform.hs don't include ghcautoconf.hJohn Ericson2019-09-251-1/+0
| | | | | It doesn't need it, and it shouldn't need it or else multi-target will break.
* Add -Wderiving-defaults (#15839)Kari Pahula2019-09-259-4/+59
| | | | | | Enabling both DeriveAnyClass and GeneralizedNewtypeDeriving can cause a warning when no explicit deriving strategy is in use. This change adds an enable/suppress flag for it.
* Add ghcide configuration filesMatthew Pickering2019-09-243-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds three new files 1. A hie.yaml file to the project root which specifies to IDEs how to set up the correct environment for loading GHC. This currently specifies to call the `./hadrian/hie-bios` script. 2. A `hie.yaml` file for the hadrian subcomponent, which uses the `cabal` cradle type. 2. The `./hadrian/hie-bios` script which supplies the correct arguments for an IDE to start a session. With these two files it is possible to run ``` ghcide compiler/ ``` and successfully load all the modules for use in the IDE. or ``` ghcide --cwd hadrian/ src/ ``` to test loading all of Hadrian's modules. Closes #17194
* Fix bounds check in ocResolve_PEi386 for relocation values.Andreas Klebinger2019-09-241-2/+2
| | | | | | | | The old test was wrong at least for gcc and the value -2287728808L. It also relied on implementation defined behaviour (right shift on a negative value), which might or might not be ok. Either way it's now a simple comparison which will always work.
* testsuite: Mark threadstatus-9333 as fragile in profthreadedBen Gamari2019-09-241-1/+1
| | | | Due to #16555.
* hadrian: Update source-repositoryBen Gamari2019-09-241-1/+1
|
* gitlab-ci: Bump ci-imagesBen Gamari2019-09-241-1/+1
| | | | | This bumps the CI Docker images to ghc/ci-images@990c5217d1d0e03aea415f951afbc3b1a89240c6.
* base: Add link to "A reflection on types"Ben Gamari2019-09-241-0/+1
| | | | Fixes #17181.
* Fix some duplication in the parserSebastian Graf2019-09-241-20/+4
| | | | | | | | | | | | | | | | | | | | | | D3673 experienced reduce/reduce conflicts when trying to use opt_instance for associated data families. That was probably because the author tried to use it for Haskell98-syntax without also applying it to GADT-syntax, which actually leads to a reduce/reduce conflict. Consider the following state: ``` data . T = T data . T where T :: T ``` The parser must decide at this point whether or not to reduce an empty `opt_instance`. But doing so would also commit to either Haskell98 or GADT syntax! Good thing we also accept an optional "instance" for GADT syntax, so the `opt_instance` is there in both productions and there's no reduce/reduce conflict anymore. Also no need to inline `opt_instance`, how it used to be.
* Hadrian: Add -haddock option for GHCi's :doc commandTakenobu Tani2019-09-242-2/+2
| | | | | | | | | | | | | | This commit adds -haddock option to Hadrian-based build system. To enable :doc command on GHCi, core libraries must be compiled with -haddock option. Especially, the `-haddock` option is essential for a release build. Assuming current GitLab CI condition (.gitlab-ci.yml), I add -haddock option to the default flavour only. This has already been done for Make-based build system. Please see #16415.
* Some leftovers from !1732. Comments only [skip ci]Sebastian Graf2019-09-242-3/+4
|
* Add -fkeep-going to make compiler continue despite errors (#15424)Kari Pahula2019-09-2315-3/+103
| | | | | Add a new optional failure handling for upsweep which continues the compilation on other modules if any of them has errors.
* [hadrian] Rebuild programs on dynamicGhcPrograms/ghcProfiled changeArtem Pyanykh2019-09-2310-20/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if you change these ^ flavour parameters, rebuilding is not triggered, since `programContext` doesn't set up a dependency on those values. Exposing these values via an oracle does set the dependency and properly triggers a rebuild of binaries. Several attempts to factor out these actions ended up in cyclic dependency here or there. I'm not absolutely happy with this variant either, but at least it works. ==== Issue repro: In UserSettings.hs: ``` dbgDynamic = defaultFlavour { name = "dbg-dynamic" , dynamicGhcPrograms = pure True, ... } dbgStatic = defaultFlavour { name = "dbg-static" , dynamicGhcPrograms = pure False ... } ``` Then in console: ``` $ hadrian/build.sh -j --flavour=dbg-dynamic ... does the build $ hadrian/build.sh -j --flavour=dbg-static ... does nothing, considers binaries up to date ```
* sort-paragraphs in runBuilderWithBjörn Gohla2019-09-231-11/+13
|
* alphabetical orderingBjörn Gohla2019-09-231-4/+4
|
* explicit dependence on makeinfoBjörn Gohla2019-09-233-5/+13
|
* detect makeinfo in configure(.ac)Björn Gohla2019-09-231-1/+12
|
* use the Make builder instead of raw cmd_Björn Gohla2019-09-231-1/+5
|
* add Hadrian rule to build user guide as Info bookBjörn Gohla2019-09-235-3/+27
|
* base: add newtypes for socklen_t and ndfs_t to System.Posix.Types #16568Adam Sandberg Eriksson2019-09-235-6/+33
| | | | | | Metric Increase: haddock.base T4029
* users-guide: Fix links and formats for GHC 8.10Takenobu Tani2019-09-237-24/+24
| | | | | | This commit only fixes links and markdown syntax. [skip ci]
* gitlab-ci: Fix URL of Windows cabal-install tarballBen Gamari2019-09-231-1/+1
|
* rts: TraverseHeap: Add doc comment for getTraverseStackMaxSizeDaniel Gröber2019-09-221-0/+3
|
* rts: RetainerProfile: Explain retainVisitClosure return valuesDaniel Gröber2019-09-221-3/+3
| | | | [ci skip]
* rts: TraverseHeap: Move stackElement.cp back into nextPos unionDaniel Gröber2019-09-221-6/+7
| | | | | The 'cp' field really is only used when type==posTypeFresh so it's more space efficient to have it in the nextPos union.
* rts: TraverseHeap: Make pushStackElement argument constDaniel Gröber2019-09-221-4/+4
|
* rts: TraverseHeap: Make comment style consistentDaniel Gröber2019-09-222-60/+64
|
* rts: Split heap traversal from retainer profilerDaniel Gröber2019-09-223-1353/+1372
| | | | | This finally moves the newly generalised heap traversal code from the retainer profiler into it's own file.
* rts: RetainerProfile.c: Minimize #includesDaniel Gröber2019-09-221-8/+1
| | | | | A lot of these includes are presumably leftovers from when the retainer profiler still did it's own heap profiling.