summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* Fix typosBrian Wignall2021-02-064-6/+6
|
* The Char kind (#11342)Daniel Rogozin2021-02-062-6/+17
| | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io> Implement GHC Proposal #387 * Parse char literals 'x' at the type level * New built-in type families CmpChar, ConsSymbol, UnconsSymbol * New KnownChar class (cf. KnownSymbol and KnownNat) * New SomeChar type (cf. SomeSymbol and SomeNat) * CharTyLit support in template-haskell Updated submodules: binary, haddock. Metric Decrease: T5205 haddock.base Metric Increase: Naperian T13035
* Fix typo in qualified_do.rstBasile Henry2021-02-051-1/+1
|
* Documentation fixesKrzysztof Gogolewski2021-01-3015-60/+40
| | | | | | | | | | | | | | | - Add missing :since: for NondecreasingIndentation and OverlappingInstances - Remove duplicated descriptions for Safe Haskell flags and UndecidableInstances. Instead, the sections contain a link. - compare-flags: Also check for options supported by ghci. This uncovered two more that are not documented. The flag -smp was removed. - Formatting fixes - Remove the warning about -XNoImplicitPrelude - it was written in 1996, the extension is no longer dangerous. - Fix misspelled :reverse: flags Fixes #18958.
* Fix description of -fregs-graph (not implied by -O2, linked issue was closed)Benjamin Maurer2021-01-301-4/+1
|
* compare-flags: Strip whitespace from flags read from --show-optionsGHC GitLab CI2021-01-301-2/+2
| | | | Otherwise we end up with terminating \r characters on Windows.
* ghci: Take editor from VISUAL environment variableBen Gamari2021-01-302-3/+19
| | | | | | Following the example of `git`, as noted in #19030. Fixes #19030.
* Fix parsing of -fstg-lift-lams-non-recKrzysztof Gogolewski2021-01-292-4/+2
| | | | | | | | -fstg-lift-lams-rec-* and -fstg-lift-lams-non-rec-* were setting the same field. Fix manual: -fstg-lift-lams-non-rec-args is disabled by -fstg-lift-lams-non-rec-args-any, there's no -fno-stg-lift-*.
* Fix code formatting in `HasCallStack` sectionDenis Frezzato2021-01-281-1/+1
|
* Remove some redundant validity checks.Richard Eisenberg2021-01-278-144/+30
| | | | | | | | | | | | This commit also consolidates documentation in the user manual around UndecidableSuperClasses, UndecidableInstances, and FlexibleContexts. Close #19186. Close #19187. Test case: typecheck/should_compile/T19186, typecheck/should_fail/T19187{,a}
* Add a section about failable patterns in the GHC user's guideHécate2021-01-271-0/+31
|
* Remove -XMonadFailDesugaring referencesHécate2021-01-272-24/+0
|
* Deprecate -h flagMatthew Pickering2021-01-272-2/+6
| | | | | | | | | | It is confusing that it defaults to two different things depending on whether we are in the profiling way or not. Use -hc if you have a profiling build Use -hT if you have a normal build Fixes #19031
* Separate AST from GhcPass (#18936)John Ericson2021-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------- What: There are two splits. The first spit is: - `Language.Haskell.Syntax.Extension` - `GHC.Hs.Extension` where the former now just contains helpers like `NoExtCon` and all the families, and the latter is everything having to do with `GhcPass`. The second split is: - `Language.Haskell.Syntax.<mod>` - `GHC.Hs.<mod>` Where the former contains all the data definitions, and the few helpers that don't use `GhcPass`, and the latter contains everything else. The second modules also reexport the former. ---------------- Why: See the issue for more details, but in short answer is we're trying to grasp at the modularity TTG is supposed to offer, after a long time of mainly just getting the safety benefits of more complete pattern matching on the AST. Now, we have an AST datatype which, without `GhcPass` is decently stripped of GHC-specific concerns. Whereas before, not was it GHC-specific, it was aware of all the GHC phases despite the parameterization, with the instances and parametric data structure side-by-side. For what it's worth there are also some smaller, imminent benefits: - The latter change also splits a strongly connected component in two, since none of the `Language.Haskell.Syntax.*` modules import the older ones. - A few TTG violations (Using GhcPass directly in the AST) in `Expr` are now more explicitly accounted for with new type families to provide the necessary indirection. ----------------- Future work: - I don't see why all the type families should live in `Language.Haskell.Syntax.Extension`. That seems anti-modular for little benefit. All the ones used just once can be moved next to the AST type they serve as an extension point for. - Decide what to do with the `Outputable` instances. Some of these are no orphans because they referred to `GhcPass`, and had to be moved. I think the types could be generalized so they don't refer to `GhcPass` and therefore can be moved back, but having gotten flak for increasing the size and complexity types when generalizing before, I did *not* want to do this. - We should triage the remaining contents of `GHC.Hs.<mod>`. The renaming helpers are somewhat odd for needing `GhcPass`. We might consider if they are a) in fact only needed by one phase b) can be generalized to be non-GhcPass-specific (e.g. take a callback rather than GADT-match with `IsPass`) and then they can live in `Language.Haskell.Syntax.<mod>`. For more details, see https://gitlab.haskell.org/ghc/ghc/-/wikis/implementing-trees-that-grow Bumps Haddock submodule
* Fix error recovery in solveEqualitiesSimon Peyton Jones2021-01-221-4/+11
| | | | | | | | | | | | | | | | | | | As #19142 showed, with -fdefer-type-errors we were allowing compilation to proceed despite a fatal kind error. This patch fixes it, as described in the new note in GHC.Tc.Solver, Note [Wrapping failing kind equalities] Also fixes #19158 Also when checking default( ty1, ty2, ... ) only consider a possible default (C ty2) if ty2 is kind-compatible with C. Previously we could form kind-incompatible constraints, with who knows what kind of chaos resulting. (Actually, no chaos results, but that's only by accident. It's plain wrong to form the constraint (Num Either) for example.) I just happened to notice this during fixing #19142.
* rts/eventlog: Reset ticky counters after dumping sampleBen Gamari2021-01-171-1/+1
|
* rts/eventlog: Introduce event to demarcate new ticky sampleBen Gamari2021-01-171-0/+7
|
* Update expected-undocumented-flags.txtBenjamin Maurer2021-01-101-1/+0
|
* Document flag -dasm-lint in debugging.rstBenjamin Maurer2021-01-101-0/+7
|
* gone_wrong.rst: remove duplicate termGreg Steuck2021-01-091-1/+1
|
* intro.rst: remove duplication of release references and fix a linkGreg Steuck2021-01-091-6/+1
|
* docs: Various release notes changesBen Gamari2021-01-071-9/+20
| | | | | | * Mention changed in profiler's treatment of PINNED closures * Fix formatting * Move plugins-relevant changes to GHC API section
* users-guide: Remove space from -ol documentationBen Gamari2021-01-071-2/+2
| | | | This flag requires that there be no space between the filename and the argument.
* rts: Enforce that mark-region isn't used with -hBen Gamari2021-01-071-0/+11
| | | | | | | As noted in #9666, the mark-region GC is not compatible with heap profiling. Also add documentation for this flag. Closes #9666.
* Docs: Remove reference to `type_applications` in `exts/patterns.rst`Joachim Breitner2021-01-021-1/+0
| | | | | it is unclear why it is there, and it is _also_ linked from `exts/types.rst`.
* base: add Numeric.{readBin, showBin} (fix #19036)Artem Pelenitsyn2021-01-021-0/+3
|
* INLINE pragma for patterns (#12178)Cale Gibbard2020-12-311-0/+34
| | | | | Allow INLINE and NOINLINE pragmas to be used for patterns. Those are applied to both the builder and matcher (where applicable).
* Document scoping of named wildcard type variablesSimon Peyton Jones2020-12-231-0/+14
| | | | | | See `Note [Scoping of named wildcards]` in GHC.Hs.Type This lack of documentation came up in #19051.
* Increase -A default to 4MB.Andreas Klebinger2020-12-221-4/+11
| | | | | | | | | | | This gives a small increase in performance under most circumstances. For single threaded GC the improvement is on the order of 1-2%. For multi threaded GC the results are quite noisy but seem to fall into the same ballpark. Fixes #16499
* rts: enable thread label table in all RTS flavours #17972Adam Sandberg Ericsson2020-12-201-1/+1
|
* Correct documentation around -XTypeOperatorsRichard Eisenberg2020-12-201-18/+25
| | | | Close #19064
* Add two warnings to -WallTom Ellis2020-12-191-2/+0
| | | | | | | * -Wincomplete-uni-patterns * -Wincomplete-record-updates See https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* Reject dodgy scoping in associated family instance RHSesRyan Scott2020-12-171-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e63518f5d6a93be111f9108c0990a1162f88d615 tried to push all of the logic of detecting out-of-scope type variables on the RHSes of associated type family instances to `GHC.Tc.Validity` by deleting a similar check in the renamer. Unfortunately, this commit went a little too far, as there are some corner cases that `GHC.Tc.Validity` doesn't detect. Consider this example: ```hs class C a where data D a instance forall a. C Int where data instance D Int = MkD a ``` If this program isn't rejected by the time it reaches the typechecker, then GHC will believe the `a` in `MkD a` is existentially quantified and accept it. This is almost surely not what the user wants! The simplest way to reject programs like this is to restore the old validity check in the renamer (search for `improperly_scoped` in `rnFamEqn`). Note that this is technically a breaking change, since the program in the `polykinds/T9574` test case (which previously compiled) will now be rejected: ```hs instance Funct ('KProxy :: KProxy o) where type Codomain 'KProxy = NatTr (Proxy :: o -> *) ``` This is because the `o` on the RHS will now be rejected for being out of scope. Luckily, this is simple to repair: ```hs instance Funct ('KProxy :: KProxy o) where type Codomain ('KProxy @o) = NatTr (Proxy :: o -> *) ``` All of the discussion is now a part of the revamped `Note [Renaming associated types]` in `GHC.Rename.Module`. A different design would be to make associated type family instances have completely separate scoping from the parent instance declaration, much like how associated type family default declarations work today. See the discussion beginning at https://gitlab.haskell.org/ghc/ghc/-/issues/18021#note_265729 for more on this point. This, however, would break even more programs that are accepted today and likely warrants a GHC proposal before going forward. In the meantime, this patch fixes the issue described in #18021 in the least invasive way possible. There are programs that are accepted today that will no longer be accepted after this patch, but they are arguably pathological programs, and they are simple to repair. Fixes #18021.
* User guide minor typoDavid Eichmann2020-12-171-1/+1
| | | | [ci skip]
* Revert "Implement BoxedRep proposal"Ben Gamari2020-12-153-19/+9
| | | | | | This was inadvertently merged. This reverts commit 6c2eb2232b39ff4720fda0a4a009fb6afbc9dcea.
* Implement BoxedRep proposalAndrew Martin2020-12-143-9/+19
| | | | | | | | | | | | | | | | | | This implements the BoxedRep proposal, refacoring the `RuntimeRep` hierarchy from: ```haskell data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ... ``` to ```haskell data RuntimeRep = BoxedRep Levity | ... data Levity = Lifted | Unlifted ``` Closes #17526.
* Implement type applications in patternsCale Gibbard2020-12-142-1/+83
| | | | | The haddock submodule is also updated so that it understands the changes to patterns.
* users guide: Describe GC lifecycle eventsBen Gamari2020-12-112-4/+100
| | | | | | Every time I am asked about how to interpret these events I need to figure it out from scratch. It's well past time that the users guide properly documents these.
* users guide: Fix syntax errorsBen Gamari2020-12-111-23/+21
| | | | Fixes errors introduced by 3a55b3a2574f913d046f3a6f82db48d7f6df32e3.
* doc: Extra-clarify -fomit-yieldsKirill Elagin2020-12-101-1/+1
| | | | Be more clear on what this optimisation being on by default means in terms of yields.
* doc: Clarify the default for -fomit-yieldsKirill Elagin2020-12-101-1/+1
| | | | | | “Yield points enabled” is confusing (and probably wrong? I am not 100% sure what it means). Change it to a simple “on”. Undo this change from 2c23fff2e03e77187dc4d01f325f5f43a0e7cad2.
* Fix kind inference for data types. Again.Simon Peyton Jones2020-12-082-85/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes several aspects of kind inference for data type declarations, especially data /instance/ declarations Specifically 1. In kcConDecls/kcConDecl make it clear that the tc_res_kind argument is only used in the H98 case; and in that case there is no result kind signature; and hence no need for the disgusting splitPiTys in kcConDecls (now thankfully gone). The GADT case is a bit different to before, and much nicer. This is what fixes #18891. See Note [kcConDecls: kind-checking data type decls] 2. Do not look at the constructor decls of a data/newtype instance in tcDataFamInstanceHeader. See GHC.Tc.TyCl.Instance Note [Kind inference for data family instances]. This was a new realisation that arose when doing (1) This causes a few knock-on effects in the tests suite, because we require more information than before in the instance /header/. New user-manual material about this in "Kind inference in data type declarations" and "Kind inference for data/newtype instance declarations". 3. Minor improvement in kcTyClDecl, combining GADT and H98 cases 4. Fix #14111 and #8707 by allowing the header of a data instance to affect kind inferece for the the data constructor signatures; as described at length in Note [GADT return types] in GHC.Tc.TyCl This led to a modest refactoring of the arguments (and argument order) of tcConDecl/tcConDecls. 5. Fix #19000 by inverting the sense of the test in new_locs in GHC.Tc.Solver.Canonical.canDecomposableTyConAppOK.
* Remove flattening variablesRichard Eisenberg2020-12-013-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch redesigns the flattener to simplify type family applications directly instead of using flattening meta-variables and skolems. The key new innovation is the CanEqLHS type and the new CEqCan constraint (Ct). A CanEqLHS is either a type variable or exactly-saturated type family application; either can now be rewritten using a CEqCan constraint in the inert set. Because the flattener no longer reduces all type family applications to variables, there was some performance degradation if a lengthy type family application is now flattened over and over (not making progress). To compensate, this patch contains some extra optimizations in the flattener, leading to a number of performance improvements. Close #18875. Close #18910. There are many extra parts of the compiler that had to be affected in writing this patch: * The family-application cache (formerly the flat-cache) sometimes stores coercions built from Given inerts. When these inerts get kicked out, we must kick out from the cache as well. (This was, I believe, true previously, but somehow never caused trouble.) Kicking out from the cache requires adding a filterTM function to TrieMap. * This patch obviates the need to distinguish "blocking" coercion holes from non-blocking ones (which, previously, arose from CFunEqCans). There is thus some simplification around coercion holes. * Extra commentary throughout parts of the code I read through, to preserve the knowledge I gained while working. * A change in the pure unifier around unifying skolems with other types. Unifying a skolem now leads to SurelyApart, not MaybeApart, as documented in Note [Binding when looking up instances] in GHC.Core.InstEnv. * Some more use of MCoercion where appropriate. * Previously, class-instance lookup automatically noticed that e.g. C Int was a "unifier" to a target [W] C (F Bool), because the F Bool was flattened to a variable. Now, a little more care must be taken around checking for unifying instances. * Previously, tcSplitTyConApp_maybe would split (Eq a => a). This is silly, because (=>) is not a tycon in Haskell. Fixed now, but there are some knock-on changes in e.g. TrieMap code and in the canonicaliser. * New function anyFreeVarsOf{Type,Co} to check whether a free variable satisfies a certain predicate. * Type synonyms now remember whether or not they are "forgetful"; a forgetful synonym drops at least one argument. This is useful when flattening; see flattenView. * The pattern-match completeness checker invokes the solver. This invocation might need to look through newtypes when checking representational equality. Thus, the desugarer needs to keep track of the in-scope variables to know what newtype constructors are in scope. I bet this bug was around before but never noticed. * Extra-constraints wildcards are no longer simplified before printing. See Note [Do not simplify ConstraintHoles] in GHC.Tc.Solver. * Whether or not there are Given equalities has become slightly subtler. See the new HasGivenEqs datatype. * Note [Type variable cycles in Givens] in GHC.Tc.Solver.Canonical explains a significant new wrinkle in the new approach. * See Note [What might match later?] in GHC.Tc.Solver.Interact, which explains the fix to #18910. * The inert_count field of InertCans wasn't actually used, so I removed it. Though I (Richard) did the implementation, Simon PJ was very involved in design and review. This updates the Haddock submodule to avoid #18932 by adding a type signature. ------------------------- Metric Decrease: T12227 T5030 T9872a T9872b T9872c Metric Increase: T9872d -------------------------
* Set dynamic users-guide TOC spacing (fixes #18554)Tim Barnes2020-11-261-0/+3
|
* Implement -ddump-c-backend argumentBen Gamari2020-11-221-0/+9
| | | | To dump output of the C backend.
* rts: Post ticky entry counts to the eventlogBen Gamari2020-11-213-4/+49
| | | | | | | | We currently only post the entry counters, not the other global counters as in my experience the former are more useful. We use the heap profiler's census period to decide when to dump. Also spruces up the documentation surrounding ticky-ticky a bit.
* Move Plugins into HscEnv (#17957)Sylvain Henry2020-11-211-7/+11
| | | | | | | | | | Loaded plugins have nothing to do in DynFlags so this patch moves them into HscEnv (session state). "DynFlags plugins" become "Driver plugins" to still be able to register static plugins. Bump haddock submodule
* Introduce -fprof-callers flagBen Gamari2020-11-212-0/+36
| | | | | | | | This introducing a new compiler flag to provide a convenient way to introduce profiler cost-centers on all occurrences of the named identifier. Closes #18566.
* users-guide: A bit of clean-up in profiling flag documentationBen Gamari2020-11-211-43/+31
|
* Update user's guide entry on demand analysis and worker/wrapperSebastian Graf2020-11-204-24/+170
| | | | | | | | | The demand signature notation has been undocumented for a long time. The only source to understand it, apart from reading the `Outputable` instance, has been an outdated wiki page. Since the previous commits have reworked the demand lattice, I took it as an opportunity to also write some documentation about notation.