summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* 'forall' always a keyword, plus the dot type operatorVladislav Zavialov2019-02-151-1/+5
|
* Implement -Wredundant-record-wildcards and -Wunused-record-wildcardsMatthew Pickering2019-02-142-3/+92
| | | | | | | | | -Wredundant-record-wildcards warns when a .. pattern binds no variables. -Wunused-record-wildcards warns when none of the variables bound by a .. pattern are used. These flags are enabled by `-Wall`.
* NCG: fast compilation of very large strings (#16190)Sylvain Henry2019-02-141-0/+16
| | | | | | | | | | This patch adds an optimization into the NCG: for large strings (threshold configurable via -fbinary-blob-threshold=NNN flag), instead of printing `.asciz "..."` in the generated ASM source, we print `.incbin "tmpXXX.dat"` and we dump the contents of the string into a temporary "tmpXXX.dat" file. See the note for more details.
* ImplicitParams does not imply FlexibleContexts or FlexibleInstances, fixes ↵Neil Mitchell2019-02-081-4/+1
| | | | #16248
* Add `-fplugin-trustworthy` to avoid marking modules as unsafeZejun Wu2019-02-041-0/+10
| | | | | | | | By default, when a module is compiled with plugins, it will be marked as unsafe. With this flag passed, all plugins are treated as trustworthy and the safety inference will no longer be affected. This fixes Trac #16260.
* docs: change meta-variable of -interactive-print from expr to nameZejun Wu2019-02-031-4/+4
| | | | | `-interactive-print` doesn't accept **expr** as `-e` or `:def` does. It must be a qualified or unqualified **name** in scope.
* Add -fdefer-diagnostics to defer and group diagnostic messages in make-modeZejun Wu2019-01-311-0/+12
| | | | | | | | | | | | | When loading many modules in parallel there can a lot of warnings and errors get mixed up with regular output. When the compilation fails, the relevant error message can be thousands of lines backward and is hard to find. When the compilation successes, warning message is likely to be ignored as it is not seen. We can address this by deferring the warning and error message after the compilation. We also put errors after warnings so it is more visible. This idea was originally proposed by Bartosz Nitka in https://phabricator.haskell.org/D4219.
* Add a RTS option -xp to load PIC object anywhere in address spaceZejun Wu2019-01-302-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This re-applies {D5195} with fixes for i386: * Fix unused label warnings, see {D5230} or {D5273} * Fix a silly bug introduced by moving `#if` {P190} Add a RTS option -xp to load PIC object anywhere in address space. We do this by relaxing the requirement of <0x80000000 result of `mmapForLinker` and implying USE_CONTIGUOUS_MMAP. We also need to change calls to `ocInit` and `ocGetNames` to avoid dangling pointers when the address of `oc->image` is changed by `ocAllocateSymbolExtra`. Test Plan: See {D5195}, also test under i386: ``` $ uname -a Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28 20:45:30 CEST 2018 i686 GNU/Linux $ cd testsuite/tests/th/ && make test ... ``` will run `./validate` on stacked diff. Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5289
* Include type info for only some exprs in HIE filesAlec Theriault2019-01-301-0/+5
| | | | | | | | | | | | | | | | This commit relinquishes some some type information in `.hie` files in exchange for better performance. See #16233 for more on this. Using `.hie` files to generate hyperlinked sources is a crucial milestone towards Hi Haddock (the initiative to move Haddock to work over `.hi` files and embed docstrings in those). Unfortunately, even after much optimization on the Haddock side, the `.hie` based solution is still considerably slower and more memory hungry than the existing implementation - and the @.hie@ code is to blame. This changes `.hie` file generation to track type information for only a limited subset of expressions (specifically, those that might eventually turn into hyperlinks in the Haddock's hyperlinker backend).
* Compile count{Leading,Trailing}Zeros to corresponding x86_64 instructions ↵Dmitry Ivanov2019-01-301-0/+10
| | | | | | | under -mbmi2 This works similarly to existing implementation for popCount. Trac ticket: #16086.
* Revert "Batch merge"Ben Gamari2019-01-304-45/+2
| | | | This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.
* Batch mergeBen Gamari2019-01-304-2/+45
|
* A few typofixesGabor Greif2019-01-231-1/+1
|
* users guide: fix typesetting of pragmasBen Price2019-01-231-3/+4
|
* users guide: consistent spelling of inlinableBen Price2019-01-231-1/+1
|
* doc: behaviour of +RTS -h depends on profilingBen Price2019-01-162-0/+9
| | | | | | The rts option `-h` behaves as `-hT` when compiled without profiling, and `-hc` when compiled with profiling. Add a note to the user's guide highlighting this inconsistency.
* Add -Wmissing-deriving-strategieschessai2019-01-063-0/+26
| | | | | | | | | | | | | | | Warn users when -XDerivingStrategies is enabled but not used, at each potential use site. add -Wmissing-deriving-strategies Reviewers: bgamari, RyanGlScott Subscribers: andrewthad, rwbarton, carter GHC Trac Issues: #15798 Differential Revision: https://phabricator.haskell.org/D5451
* Fix broken links (#16125)Sven Tennie2019-01-051-6/+7
|
* Visible kind applicationmynguyen2019-01-031-7/+11
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements visible kind application (GHC Proposal 15/#12045), as well as #15360 and #15362. It also refactors unnamed wildcard handling, and requires that type equations in type families in Template Haskell be written with full type on lhs. PartialTypeSignatures are on and warnings are off automatically with visible kind application, just like in term-level. There are a few remaining issues with this patch, as documented in ticket #16082. Includes a submodule update for Haddock. Test Plan: Tests T12045a/b/c/TH1/TH2, T15362, T15592a Reviewers: simonpj, goldfire, bgamari, alanz, RyanGlScott, Iceland_jack Subscribers: ningning, Iceland_jack, RyanGlScott, int-index, rwbarton, mpickering, carter GHC Trac Issues: `#12045`, `#15362`, `#15592`, `#15788`, `#15793`, `#15795`, `#15797`, `#15799`, `#15801`, `#15807`, `#15816` Differential Revision: https://phabricator.haskell.org/D5229
* stg-spec: Modify `.lhs` to `.hs`Takenobu Tani2019-01-031-10/+10
| | | | | | | | | | Modify old filename `.lhs` to `.hs` in the following file: * docs/stg-spec/StgSyn.ott Since PDF has not been registered in the past, I have not committed generated PDF(`stg-spec.pdf`). [ci skip]
* core-spec: Modify `.lhs` to `.hs` (generated PDF)Takenobu Tani2019-01-021-0/+0
| | | | | | | | Modify old filename `.lhs` to `.hs` in following file: * docs/core-spec/core-spec.pdf (generated PDF) [ci skip]
* core-spec: Modify `.lhs` to `.hs` (source files)Takenobu Tani2019-01-024-80/+80
| | | | | | | | | | | Modify old filename `.lhs` to `.hs` in following files: * docs/core-spec/README * docs/core-spec/CoreLint.ott * docs/core-spec/CoreSyn.ott * docs/core-spec/core-spec.mng [ci skip]
* configure: introduce HAPPY and ALEX vars and deprecate --with-ghc in favour ↵Adam Sandberg Eriksson2019-01-011-0/+3
| | | | | | of the GHC var Also updates the windows gitlab ci to use the new configure variables.
* Improve documention of TypeInTypeSimon Peyton Jones2018-12-211-2/+3
|
* Use https links in user-facing startup and error messagesBen Gamari2018-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | I consider myself lucky that in my circle of friends, `http` urls (as opposed to `https` urls) are frowned upon in that we generally apologize in the rase cases that we share an `http` url. This pull request changes `http` links into their `https` analogues in the following places: * In the GHCI startup message (and parts of the User's Guide, where there are verbatim transcripts of GHCi sessions). * In a couple of error messages, asking the user to report a bug. (I also took the liberty to change a single space before the reportabug url into two spaces, harmonizing this occurence with the others.) I'm not trying to start a war. I just had a moment to spare and felt like preparing this diff. Merge or don't merge as you wish! Reviewers: bgamari, erikd, simonmar Subscribers: goldfire, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5450
* Fix recompilation checking of pure pluginsDaniel Gröber2018-12-121-4/+15
| | | | | | | | | | | | | | | | | | | Previously when switching from using a Plugin with `RecompMaybe`/`ForceRecompile` in `pluginRecompile` to a Plugin with `NoForceRecompile` GHC would never even consider recompiling. However the previously active plugin could have modified the compilation output so we should recompile. Test Plan: validate Reviewers: bgamari, mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15858 Differential Revision: https://phabricator.haskell.org/D5299
* Enable rebindable fail with overloaded stringsShayne Fletcher2018-12-111-1/+4
| | | | | | | | | | | | | | Summary: enable rebindable fail with overloaded strings Reviewers: bgamari, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, ndmitchell, rwbarton, carter GHC Trac Issues: #15645 Differential Revision: https://phabricator.haskell.org/D5251
* Support generating HIE filesAlec Theriault2018-12-113-0/+61
| | | | | | | | | | | | | | | | | | | | Adds a `-fenable-ide-info` flag which instructs GHC to generate `.hie` files (see the wiki page: https://ghc.haskell.org/trac/ghc/wiki/HIEFiles). This is a rebased version of Zubin Duggal's (@wz1000) GHC changes for his GSOC project, as posted here: https://gist.github.com/wz1000/5ed4ddd0d3e96d6bc75e095cef95363d. Test Plan: ./validate Reviewers: bgamari, gershomb, nomeata, alanz, sjakobi Reviewed By: alanz, sjakobi Subscribers: alanz, hvr, sjakobi, rwbarton, wz1000, carter Differential Revision: https://phabricator.haskell.org/D5239
* RTS linker: don't crash early when not finding extra-librariesKyrill Briantsev2018-12-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow GHCi to not crash when no assumed DLL is found in the standard location. E.g. when loading the package built "dyn" way, we may well have the package's DLL around, and it's the system linker which loads necessary dependencies. Why does this (partially) fix #11042? It's because we often (and when having packages built `dyn` way -- almost always) don't need to load anything recorded in the `extra-libraries` stanza, since if the package DLL exists, GHCi linker simply calls the system linker (via `dlopen`/ `LoadLibrary` APIs) to load it and doesn't bother to load package prelinked object file (if any) or package static library. Thus, all "regular" (with no fancy low-level package content manipulation) packages built "dyn" way should be OK after this fix. Reviewers: hvr, bgamari, int-index Reviewed By: bgamari, int-index Subscribers: Phyx, int-index, rwbarton, carter GHC Trac Issues: #11042 Differential Revision: https://phabricator.haskell.org/D5170
* Add -fno-safe-haskell flagMatthew Pickering2018-12-071-0/+17
| | | | | | | | | | | | | | | | | This flag can be set to turn off the Safe Haskell checks. Whether a module is marked Safe/Unsafe/Trustworthy is ignored when this flag to set. Reviewers: bgamari, tdammers Reviewed By: tdammers Subscribers: rwbarton, carter GHC Trac Issues: #15920 Differential Revision: https://phabricator.haskell.org/D5360
* Fixed plugin example to workabc2018-12-071-14/+14
|
* Fix #12102/#15872 by removing outdated users' guide proseRyan Scott2018-12-071-36/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the beginning, #12102 (and #15872, which is of a similar ilk) were caused by a poor, confused user trying to use code that looks like this (with a constraint in the kind of a data type): ```lang=haskell type family IsTypeLit a where IsTypeLit Nat = 'True IsTypeLit Symbol = 'True IsTypeLit a = 'False data T :: forall a. (IsTypeLit a ~ 'True) => a -> * where MkNat :: T 42 MkSymbol :: T "Don't panic!" ``` Many bizarre GHC quirks (documented in those tickets) arose from this sort of construction. Ultimately, the use of constraints in data type kinds like this has made a lot of people very confused and been widely regarded as a bad move. Commit 2257a86daa72db382eb927df12a718669d5491f8 finally put this feature out of its misery, so now the code above simply errors with `Illegal constraint in a kind`. As a result, the aforementioned tickets are moot, so this patch wraps a bow on the whole thing by: 1. Removing the (now outdated) section on constraints in data type kinds from the users' guide, and 2. Adding a test case to test this code path. Test Plan: make test TEST=T12102 Reviewers: goldfire, simonpj, bgamari, tdammers Reviewed By: tdammers Subscribers: tdammers, rwbarton, carter GHC Trac Issues: #12102, #15872 Differential Revision: https://phabricator.haskell.org/D5397
* Add fusion rules for the zipWith functions in base (#15263)Tobias Decking2018-12-061-0/+4
| | | | | | | | | | | | | | | | | | | | | This patch will allow `zip3` and `zipWith3` in `GHC.List` as well as `zipWith4`, `zipWith5`, `zipWith6` and `zipWith7` in `Data.OldList` to fuse. These rules are kept in a similar style as the rules for `zip` and `zipWith`. Added a corresponding test case. Test Plan: validate Reviewers: hvr, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rockbmb, rwbarton, carter GHC Trac Issues: #15263 Differential Revision: https://phabricator.haskell.org/D5241
* Warn on all out-of-range literals in pats/exprsAlec Theriault2018-12-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These changes were motivated by #13256. While poking around, I realized we weren't very consistent in our "-Woverflowed-literals" warnings. This patch fixes that by: * warning earlier on in the pipeline (ie. before we've desugared 'Int' patterns into 'I# Int#') * handling 'HsLit' as well as 'HsOverLit' (this covers unboxed literals) * covering more pattern / expression forms 4/6 of the warnings in the 'Overflow' test are due to this patch. The other two are mostly for completeness. Also fixed a missing empty-enumeration warning for 'Natural'. This warnings were tripped up by the 'Bounded Word' instance (see #9505), but the fix was obvious and simple: use unboxed word literals. Test Plan: make TEST=Overflow && make TEST=T10930 Reviewers: hvr, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #13256, #10930 Differential Revision: https://phabricator.haskell.org/D5181
* Fix #15953 by consistently using dumpIfSet_dyn to print debug outputChaitanya Koparkar2018-11-291-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | Summary: In some modules we directly dump the debugging output to STDOUT via 'putLogMsg', 'printInfoForUser' etc. However, if `-ddump-to-file` is enabled, that output should be written to a file. Easily fixed. Certain tests (T3017, Roles3, T12763 etc.) expect part of the output generated by `-ddump-types` to be in 'PprUser' style. However, generally we want all other debugging output to use 'PprDump' style. `traceTcRn` and `traceTcRnForUser` help us accomplish this. This patch also documents some missing flags in the users guide. Reviewers: RyanGlScott, bgamari, hvr Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15953 Differential Revision: https://phabricator.haskell.org/D5382
* Fix #15828, from `More explicit foralls`Matthew Yacavone2018-11-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix a bug in commit 12eeb9 which permits the following: ``` class C a where type T a b instance C (Maybe a) where type forall a b. T (Maybe a) b = b ``` where instead, the user should write: ``` instance C (Maybe a) where type forall b. T (Maybe a) b = b ``` Update the users guide to discuss scoping of type variables in explicit foralls in type family instances. Test Plan: validate Reviewers: bgamari, goldfire, monoidal Reviewed By: goldfire Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #15828 Differential Revision: https://phabricator.haskell.org/D5283
* Use autoconf to generate version numbers for libiserv and friendsRyan Scott2018-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Currently, the version numbers for `libiserv`, `iserv`, and `iserv-proxy` are hard-coded directly into their `.cabal` files. These are easy to forget to update, and in fact, this has already happened once (see #15866). Let's use `autoconf` to do this for us so that it is not forgotten in the future. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, erikd, carter GHC Trac Issues: #15866 Differential Revision: https://phabricator.haskell.org/D5302
* users guide: Clarify meanings of -g<n> flagsBen Gamari2018-11-231-3/+9
|
* Implement late lambda liftSebastian Graf2018-11-231-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This implements a selective lambda-lifting pass late in the STG pipeline. Lambda lifting has the effect of avoiding closure allocation at the cost of having to make former free vars available at call sites, possibly enlarging closures surrounding call sites in turn. We identify beneficial cases by means of an analysis that estimates closure growth. There's a Wiki page at https://ghc.haskell.org/trac/ghc/wiki/LateLamLift. Reviewers: simonpj, bgamari, simonmar Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #9476 Differential Revision: https://phabricator.haskell.org/D5224
* Overhaul -fprint-explicit-kinds to use VKARyan Scott2018-11-221-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the behavior of `-fprint-explicit-kinds` so that it displays kind argument using visible kind application. In other words, the flag now: 1. Prints instantiations of specified variables with `@(...)`. 2. Prints instantiations of inferred variables with `@{...}`. In addition, this patch removes the `Use -fprint-explicit-kinds to see the kind arguments` error message that often arises when a type mismatch occurs due to different kinds. Instead, whenever there is a kind mismatch, we now enable the `-fprint-explicit-kinds` flag locally to help cue to the programmer where the error lies. (See `Note [Kind arguments in error messages]` in `TcErrors`.) As a result, these funny `@{...}` things can now appear to the user even without turning on the `-fprint-explicit-kinds` flag explicitly, so I took the liberty of documenting them in the users' guide. Test Plan: ./validate Reviewers: goldfire, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15871 Differential Revision: https://phabricator.haskell.org/D5314
* users guide: We no longer build libraries with -split-objsBen Gamari2018-11-221-1/+1
| | | | We now generally use split-sections instead.
* Fix trac #15702, as a followon to fix for #13704.Chris Smith2018-11-171-11/+27
| | | | | | | | | | | | | | | | | | Summary: The effect of this change is that -main-is changes the default export list for the main module, but does not apply the same change to non-main modules. This fixes some cases where -main-is was used to wrap a module that expected that default behavior (exporting `main`, even when that wasn't the main entry point name). Reviewers: mpickering, monoidal, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #13704, #15702 Differential Revision: https://phabricator.haskell.org/D5322
* Remove -Wamp flag (#11477)roland2018-11-171-0/+2
| | | | | | | | | | | | | | | | | Summary: Add line "The deprecated ghc-flag -Wamp has been removed." to the release notes for 8.8.1 Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter GHC Trac Issues: #11477 Differential Revision: https://phabricator.haskell.org/D5296
* NCG: New code layout algorithm.Andreas Klebinger2018-11-173-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements a new code layout algorithm. It has been tested for x86 and is disabled on other platforms. Performance varies slightly be CPU/Machine but in general seems to be better by around 2%. Nofib shows only small differences of about +/- ~0.5% overall depending on flags/machine performance in other benchmarks improved significantly. Other benchmarks includes at least the benchmarks of: aeson, vector, megaparsec, attoparsec, containers, text and xeno. While the magnitude of gains differed three different CPUs where tested with all getting faster although to differing degrees. I tested: Sandy Bridge(Xeon), Haswell, Skylake * Library benchmark results summarized: * containers: ~1.5% faster * aeson: ~2% faster * megaparsec: ~2-5% faster * xml library benchmarks: 0.2%-1.1% faster * vector-benchmarks: 1-4% faster * text: 5.5% faster On average GHC compile times go down, as GHC compiled with the new layout is faster than the overhead introduced by using the new layout algorithm, Things this patch does: * Move code responsilbe for block layout in it's own module. * Move the NcgImpl Class into the NCGMonad module. * Extract a control flow graph from the input cmm. * Update this cfg to keep it in sync with changes during asm codegen. This has been tested on x64 but should work on x86. Other platforms still use the old codelayout. * Assign weights to the edges in the CFG based on type and limited static analysis which are then used for block layout. * Once we have the final code layout eliminate some redundant jumps. In particular turn a sequences of: jne .foo jmp .bar foo: into je bar foo: .. Test Plan: ci Reviewers: bgamari, jmct, jrtc27, simonmar, simonpj, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, trommler, jmct, carter, thomie, rwbarton GHC Trac Issues: #15124 Differential Revision: https://phabricator.haskell.org/D4726
* Fix a typo in the description of -fabstract-refinement-hole-fitsDmitry Ivanov2018-11-171-1/+1
|
* user's guide: typo in ViewPatterns exampleBen Price2018-11-171-1/+1
|
* Correct link to GHC API in docs index.Shao Cheng2018-11-121-1/+1
|
* rts: Allow output filename of eventlog to be given by command-lineBen Gamari2018-11-022-0/+9
| | | | | | | | | | | | | | | This introduces the `+RTS -ol` flag, which allows user to specify the destination file for eventlog output. Test Plan: Validate with included test Reviewers: simonmar, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5293
* users-guide: Update link to Safe Coercions paperBen Gamari2018-11-021-1/+1
| | | | Fixes #15841.
* users-guide: Fix formatting of eventlog format documentationBen Gamari2018-11-011-0/+7
| | | | | | | | | | | | Test Plan: Read it Reviewers: mpickering Reviewed By: mpickering Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5264