summaryrefslogtreecommitdiff
path: root/docs/users_guide
Commit message (Collapse)AuthorAgeFilesLines
* Base/JS: GHC.JS.Foreign.Callback module (issue 23126)wip/js-exportsJosh Meredith2023-04-112-0/+176
| | | | | | | | | | | | | * Add the Callback module for "exporting" Haskell functions to be available to plain JavaScript code * Fix some primitives defined in GHC.JS.Prim * Add a JavaScript section to the user guide with instructions on how to use the JavaScript FFI, building up to using Callbacks to interact with the browser * Add tests for the JavaScript FFI and Callbacks
* Fix reverse flag for -Wunsupported-llvm-versionBrandon Chinn2023-04-061-1/+1
|
* TH: revert changes to GadtC & RecGadtCsheaf2023-04-011-4/+0
| | | | | | | Commit 3f374399 included a breaking-change to the template-haskell library when it made the GadtC and RecGadtC constructors take non-empty lists of names. As this has the potential to break many users' packages, we decided to revert these changes for now.
* User Guide: update copyright year: 2020->2023Artem Pelenitsyn2023-04-011-1/+1
|
* docs: move RecordUpd changelog entry to 9.8sheaf2023-03-302-5/+5
| | | | This was accidentally included in the 9.6 changelog instead of the 9.6 changelog.
* Handle records in the renamersheaf2023-03-292-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the field-based logic for disambiguating record updates to the renamer. The type-directed logic, scheduled for removal, remains in the typechecker. To do this properly (and fix the myriad of bugs surrounding the treatment of duplicate record fields), we took the following main steps: 1. Create GREInfo, a renamer-level equivalent to TyThing which stores information pertinent to the renamer. This allows us to uniformly treat imported and local Names in the renamer, as described in Note [GREInfo]. 2. Remove GreName. Instead of a GlobalRdrElt storing GreNames, which distinguished between normal names and field names, we now store simple Names in GlobalRdrElt, along with the new GREInfo information which allows us to recover the FieldLabel for record fields. 3. Add namespacing for record fields, within the OccNames themselves. This allows us to remove the mangling of duplicate field selectors. This change ensures we don't print mangled names to the user in error messages, and allows us to handle duplicate record fields in Template Haskell. 4. Move record disambiguation to the renamer, and operate on the level of data constructors instead, to handle #21443. The error message text for ambiguous record updates has also been changed to reflect that type-directed disambiguation is on the way out. (3) means that OccEnv is now a bit more complex: we first key on the textual name, which gives an inner map keyed on NameSpace: OccEnv a ~ FastStringEnv (UniqFM NameSpace a) Note that this change, along with (2), both increase the memory residency of GlobalRdrEnv = OccEnv [GlobalRdrElt], which causes a few tests to regress somewhat in compile-time allocation. Even though (3) simplified a lot of code (in particular the treatment of field selectors within Template Haskell and in error messages), it came with one important wrinkle: in the situation of -- M.hs-boot module M where { data A; foo :: A -> Int } -- M.hs module M where { data A = MkA { foo :: Int } } we have that M.hs-boot exports a variable foo, which is supposed to match with the record field foo that M exports. To solve this issue, we add a new impedance-matching binding to M foo{var} = foo{fld} This mimics the logic that existed already for impedance-binding DFunIds, but getting it right was a bit tricky. See Note [Record field impedance matching] in GHC.Tc.Module. We also needed to be careful to avoid introducing space leaks in GHCi. So we dehydrate the GlobalRdrEnv before storing it anywhere, e.g. in ModIface. This means stubbing out all the GREInfo fields, with the function forceGlobalRdrEnv. When we read it back in, we rehydrate with rehydrateGlobalRdrEnv. This robustly avoids any space leaks caused by retaining old type environments. Fixes #13352 #14848 #17381 #17551 #19664 #21443 #21444 #21720 #21898 #21946 #21959 #22125 #22160 #23010 #23062 #23063 Updates haddock submodule ------------------------- Metric Increase: MultiComponentModules MultiLayerModules MultiLayerModulesDefsGhci MultiLayerModulesNoCode T13701 T14697 hard_hole_fits -------------------------
* User's guide: Improve docs for -WallJoachim Breitner2023-03-241-22/+14
| | | | | | previously it would list the warnings _not_ enabled by -Wall. That’s unnecessary round-about and was out of date. So let's just name the relevant warnings (based on `compiler/GHC/Driver/Flags.hs`).
* Move mention of warning groups change to 9.8.1 release notesAdam Gundry2023-03-242-5/+5
|
* Allow WARNING pragmas to be controlled with custom categoriesAdam Gundry2023-03-243-19/+80
| | | | | | | | | | | | | | | | Closes #17209. This implements GHC Proposal 541, allowing a WARNING pragma to be annotated with a category like so: {-# WARNING in "x-partial" head "This function is undefined on empty lists." #-} The user can then enable, disable and set the severity of such warnings using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There is a new warning group `-Wextended-warnings` containing all these warnings. Warnings without a category are treated as if the category was `deprecations`, and are (still) controlled by the flags `-Wdeprecations` and `-Wwarnings-deprecations`. Updates Haddock submodule.
* docs: add WALL_CLOCK_TIME event in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+12
|
* docs: add TASK_DELETE event in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+9
|
* docs: add BlockedOnMVarRead thread status in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+1
|
* docs: explain the BLOCK_MARKER eventAdam Sandberg Ericsson2023-03-211-3/+4
|
* docs: fix some wrongs in the eventlog format documentationAdam Sandberg Ericsson2023-03-211-4/+7
|
* Add changelog entry for #23049Teo Camarasu2023-03-161-0/+3
|
* Constraint simplification loop now depends on `ExpansionFuel`Apoorv Ingle2023-03-061-0/+3
| | | | | | | | | | | | | | instead of a boolean flag for `CDictCan.cc_pend_sc`. Pending givens get a fuel of 3 while Wanted and quantified constraints get a fuel of 1. This helps pending given constraints to keep up with pending wanted constraints in case of `UndecidableSuperClasses` and superclass expansions while simplifying the infered type. Adds 3 dynamic flags for controlling the fuels for each type of constraints `-fgivens-expansion-fuel` for givens `-fwanteds-expansion-fuel` for wanteds and `-fqcs-expansion-fuel` for quantified constraints Fixes #21909 Added Tests T21909, T21909b Added Note [Expanding Recursive Superclasses and ExpansionFuel]
* Fix typo in docs referring to threadLabelChris Wendt2023-03-041-1/+1
|
* Export getSolo from Data.TupleDavid Feuer2023-03-031-0/+1
| | | | | | | Proposed in [CLC proposal #113](https://github.com/haskell/core-libraries-committee/issues/113) and [approved by the CLC](https://github.com/haskell/core-libraries-committee/issues/113#issuecomment-1452452191)
* Fix SCC grouping exampleTom Ellis2023-02-271-1/+1
|
* Don't specialise incoherent instance applicationsGergő Érdi2023-02-271-0/+6
| | | | | | | | | | | | | | Using incoherent instances, there can be situations where two occurrences of the same overloaded function at the same type use two different instances (see #22448). For incoherently resolved instances, we must mark them with `nospec` to avoid the specialiser rewriting one to the other. This marking is done during the desugaring of the `WpEvApp` wrapper. Fixes #22448 Metric Increase: T15304
* rts: Fix `prompt#` when profiling is enabledAlexis King2023-02-231-0/+1
| | | | | | | | | This commit also adds a new -Dk RTS option to the debug RTS to assist debugging continuation captures. Currently, the printed information is quite minimal, but more can be added in the future if it proves to be useful when debugging future issues. fixes #23001
* fix: Update documentation linksromes2023-02-211-2/+2
| | | | | | | Closes #23008 Additionally batches some fixes to pointers to the Note [Wired-in units], and a typo in said note.
* ghc-prim: levity-polymorphic array equality opssheaf2023-02-211-0/+11
| | | | | | | | | This patch changes the pointer-equality comparison operations in GHC.Prim.PtrEq to work with arrays of unlifted values, e.g. sameArray# :: forall {l} (a :: TYPE (BoxedRep l)). Array# a -> Array# a -> Int# Fixes #22976
* GHC proposal 496 - Nullary record wildcardsGeorgi Lyubenov2023-02-211-0/+6
| | | | | | | | | | | | | | | | | | | This patch implements GHC proposal 496, which allows record wildcards to be used for nullary constructors, e.g. data A = MkA1 | MkA2 { fld1 :: Int } f :: A -> Int f (MkA1 {..}) = 0 f (MkA2 {..}) = fld1 To achieve this, we add arity information to the record field environment, so that we can accept a constructor which has no fields while continuing to reject non-record constructors with more than 1 field. See Note [Nullary constructors and empty record wildcards], as well as the more general overview in Note [Local constructor info in the renamer], both in the newly introduced GHC.Types.ConInfo module. Fixes #22161
* Merge libiserv with ghciSylvain Henry2023-02-172-2/+0
| | | | | | | | | | `libiserv` serves no purpose. As it depends on `ghci` and doesn't have more dependencies than the `ghci` package, its code could live in the `ghci` package too. This commit also moves most of the code from the `iserv` program into the `ghci` package as well so that it can be reused. This is especially useful for the implementation of TH for the JS backend (#22261, !9779).
* No default finalizer exception handlersheaf2023-02-161-4/+3
| | | | | | | | | | | | Commit cfc8e2e2 introduced a mechanism for handling of exceptions that occur during Handle finalization, and 372cf730 set the default handler to print out the error to stderr. However, #21680 pointed out we might not want to set this by default, as it might pollute users' terminals with unwanted information. So, for the time being, the default handler discards the exception. Fixes #21680
* docs: add a section for the wasm backendCheng Shao2023-02-162-1/+102
| | | | Fixes #22658
* Add -single-threaded flag to force single threaded rtsOleg Grenrus2023-02-151-0/+11
| | | | | This is the small part of implementing https://github.com/ghc-proposals/ghc-proposals/pull/240
* docs: release notes, user guide: add js backenddoyougnu2023-02-152-0/+39
| | | | Follow up from #21078
* Introduce warning for loopy superclass solvesheaf2023-02-142-1/+43
| | | | | | | | | | | | | | | | | Commit aed1974e completely re-engineered the treatment of loopy superclass dictionaries in instance declarations. Unfortunately, it has the potential to break (albeit in a rather minor way) user code. To alleviate migration concerns, this commit re-introduces the old behaviour. Any reliance on this old behaviour triggers a warning, controlled by `-Wloopy-superclass-solve`. The warning text explains that GHC might produce bottoming evidence, and provides a migration strategy. This allows us to provide a graceful migration period, alerting users when they are relying on this unsound behaviour. Fixes #22912 #22891 #20666 #22894 #22905
* Mention new `Foreign.Marshal.Pool` implementation in User's Guideamesgen2023-02-141-5/+3
|
* Document that -fproc-alignment was introduced only in GHC 8.6Bodigrim2023-02-131-0/+2
|
* docs: Add section about profiling and foreign callswip/profiling-docs-refreshMatthew Pickering2023-02-131-0/+36
| | | | | | | | | Previously there was no documentation for how foreign calls interacted with the profiler. This can be quite confusing for users so getting it into the user guide is the first step to a potentially better solution. See the ticket for more insightful discussion. Fixes #21764
* Refresh profiling docsMatthew Pickering2023-02-132-150/+57
| | | | | | | I went through the whole of the profiling docs and tried to amend them to reflect current best practices and tooling. In particular I removed some old references to tools such as hp2any and replaced them with references to eventlog2html.
* Don't allow . in overloaded labelssheaf2023-02-071-1/+1
| | | | | | | | | | This patch removes . from the list of allowed characters in a non-quoted overloaded label, as it was realised this steals syntax, e.g. (#.). Users who want this functionality will have to add quotes around the label, e.g. `#"17.28"`. Fixes #22821
* Remove extraneous word in Roles user guideJan Hrček2023-02-061-1/+1
|
* docs: 9.6 release notes for wasm backendCheng Shao2023-02-021-0/+16
|
* compiler: Implement higher order patterns in the rule matcherJaro Reinders2023-02-022-1/+35
| | | | | | | | This implements proposal 555 and closes ticket #22465. See the proposal and ticket for motivation. The core changes of this patch are in the GHC.Core.Rules.match function and they are explained in the Note [Matching higher order patterns].
* User's guide: Clarify overlapping instance candidate eliminationJason Shipman2023-01-301-2/+2
| | | | | | | | | | | | This commit updates the user's guide section on overlapping instance candidate elimination to use "or" verbiage instead of "either/or" in regards to the current pair of candidates' being overlappable or overlapping. "Either IX is overlappable, or IY is overlapping" can cause confusion as it suggests "Either IX is overlappable, or IY is overlapping, but not both". This was initially discussed on this Discourse topic: https://discourse.haskell.org/t/clarification-on-overlapping-instance-candidate-elimination/5677
* nativeGen: Disable asm-shortcutting on DarwinBen Gamari2023-01-301-2/+4
| | | | | | | | | | | | | Asm-shortcutting may produce relative references to symbols defined in other compilation units. This is not something that MachO relocations support (see #21972). For this reason we disable the optimisation on Darwin. We do so without a warning since this flag is enabled by `-O2`. Another way to address this issue would be to rather implement a PLT-relocatable jump-table strategy. However, this would only benefit Darwin and does not seem worth the effort. Closes #21972.
* CApiFFI: add ConstPtr for encoding const-qualified pointer return typesnineonine2023-01-282-0/+15
| | | | | | | | | | | | | Previously, when using `capi` calling convention in foreign declarations, code generator failed to handle const-cualified pointer return types. This resulted in CC toolchain throwing `-Wincompatible-pointer-types-discards-qualifiers` warning. `Foreign.C.Types.ConstPtr` newtype was introduced to handle these cases - special treatment was put in place to generate appropritetly qualified C wrapper that no longer triggers the above mentioned warning. Fixes #22043.
* Revert "CApiFFI: add ConstPtr for encoding const-qualified pointer return ↵Ben Gamari2023-01-282-15/+0
| | | | | | types (#22043)" This reverts commit 99aca26b652603bc62953157a48e419f737d352d.
* Allow waiting for timerfd to be interrupted during rts shutdownWander Hillen2023-01-241-1/+71
|
* Clarify where `f` is definedTom Ellis2023-01-241-4/+7
|
* Set "since: 9.8" for TypeAbstractions and -Wterm-variable-captureVladislav Zavialov2023-01-235-7/+17
| | | | | These flags did not make it into the 9.6 release series, so the "since" annotations must be corrected.
* Move documentation of deferred type error flags out of warnings sectionAdam Gundry2023-01-182-62/+63
|
* Revise warnings documentation in user's guideAdam Gundry2023-01-182-34/+60
|
* Enable -Wstar-is-type by default (#22759)Vladislav Zavialov2023-01-182-4/+3
| | | | | | | | | | | | | Following the plan in GHC Proposal #143 "Remove the * kind syntax", which states: In the next release (or 3 years in), enable -fwarn-star-is-type by default. The "next release" happens to be 9.6.1 I also moved the T21583 test case from should_fail to should_compile, because the only reason it was failing was -Werror=compat in our test suite configuration.
* Document the semantics of pattern bindings a bit betterSimon Peyton Jones2023-01-172-67/+163
| | | | This MR is in response to the discussion on #22719
* Only gc sparks locally when we can ensure marking is done.Andreas Klebinger2023-01-121-3/+6
| | | | | | | | When performing GC without work stealing there was no guarantee that spark pruning was happening after marking of the sparks. This could cause us to GC live sparks under certain circumstances. Fixes #22528.