summaryrefslogtreecommitdiff
path: root/docs/users_guide/exts
Commit message (Collapse)AuthorAgeFilesLines
* Don't default type variables in type familiessheaf2021-10-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the following defaulting of type variables in type and data families: - type variables of kind RuntimeRep defaulting to LiftedRep - type variables of kind Levity defaulting to Lifted - type variables of kind Multiplicity defaulting to Many It does this by passing "defaulting options" to the `defaultTyVars` function; when calling from `tcTyFamInstEqnGuts` or `tcDataFamInstHeader` we pass options that avoid defaulting. This avoids wildcards being defaulted, which caused type families to unexpectedly fail to reduce. Note that kind defaulting, applicable only with -XNoPolyKinds, is not changed by this patch. Fixes #17536 ------------------------- Metric Increase: T12227 -------------------------
* Introduce Concrete# for representation polymorphism checkssheaf2021-10-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PHASE 1: we never rewrite Concrete# evidence. This patch migrates all the representation polymorphism checks to the typechecker, using a new constraint form Concrete# :: forall k. k -> TupleRep '[] Whenever a type `ty` must be representation-polymorphic (e.g. it is the type of an argument to a function), we emit a new `Concrete# ty` Wanted constraint. If this constraint goes unsolved, we report a representation-polymorphism error to the user. The 'FRROrigin' datatype keeps track of the context of the representation-polymorphism check, for more informative error messages. This paves the way for further improvements, such as allowing type families in RuntimeReps and improving the soundness of typed Template Haskell. This is left as future work (PHASE 2). fixes #17907 #20277 #20330 #20423 #20426 updates haddock submodule ------------------------- Metric Decrease: T5642 -------------------------
* Document interaction between unsafe FFI and GCAlexander Kjeldaas2021-09-291-5/+23
| | | | | In the multi-threaded RTS this can lead to hard to debug performance issues.
* Remove outdated note about pragma layouttaylorfausak2021-09-281-3/+1
|
* Documentation: use https linksKrzysztof Gogolewski2021-09-0823-48/+48
|
* Minor doc fixesKrzysztof Gogolewski2021-09-083-23/+25
| | | | | | | | | | | | | - Fix markup in 9.4 release notes - Document -ddump-cs-trace - Mention that ImpredicativeTypes is really supported only since 9.2 - Remove "There are some restrictions on the use of unboxed tuples". This used to be a list, but all those restrictions were removed. - Mark -fimplicit-import-qualified as documented - Remove "The :main and :run command" - duplicated verbatim in options - Avoid calling "main" a function (cf. #7816) - Update System.getArgs: the old location was before hierarchical modules - Note that multiplicity multiplication is not supported (#20319)
* Fix code example in the documentation of subsumptionARATA Mizuki2021-09-071-1/+1
|
* Disable -fdefer-type-errors for linear types (#20083)Krzysztof Gogolewski2021-08-041-0/+5
|
* Add Generically (generic Semigroup, Monoid instances) and Generically1 ↵Baldur Blöndal2021-08-021-5/+26
| | | | (generic Functor, Applicative, Alternative, Eq1, Ord1 instances) to GHC.Generics.
* Improve docs of bang patterns (#19068)Krzysztof Gogolewski2021-07-281-43/+62
|
* Document DerivingVia unsafety (#19786)Krzysztof Gogolewski2021-07-281-2/+3
|
* Docs: use :default: and :ghc-ticket:Krzysztof Gogolewski2021-07-286-8/+7
|
* Use HsExpansion for overloaded list patternssheaf2021-06-291-0/+12
| | | | Fixes #14380, #19997
* user-guide: Improve documentation of NumDecimalsZubin Duggal2021-06-271-6/+16
|
* Update quantified_constraints.rstChristian Takle2021-06-241-2/+2
|
* There's no "errorWithCallStack", just use "error".Viktor Dukhovni2021-06-241-9/+8
| | | | | | | | There's no `errorWithCallStack`, only `errorWithStackTrace`, but the latter is now deprecated, since `error` now defaults to returning a stack strace. So rather than change this to the intended deprecated function we replace `errorWithCallStack` with `error` instead.
* Fix a typo in pattern synonyms docPotato Hatsue2021-06-221-2/+2
|
* Typos, minor comment fixesKrzysztof Gogolewski2021-06-221-0/+1
| | | | | | | | | | | | | | | | | | | - Remove fstName, sndName, fstIdKey, sndIdKey - no longer used, removed from basicKnownKeyNames - Remove breakpointId, breakpointCondId, opaqueTyCon, unknownTyCon - they were used in the old implementation of the GHCi debugger - Fix typos in comments - Remove outdated comment in Lint.hs - Use 'LitRubbish' instead of 'RubbishLit' for consistency - Remove comment about subkinding - superseded by Note [Kind Constraint and kind Type] - Mention ticket ID in a linear types error message - Fix formatting in using-warnings.rst and linear-types.rst - Remove comment about 'Any' in Dynamic.hs - Dynamic now uses Typeable + existential instead of Any - Remove codeGen/should_compile/T13233.hs This was added by accident, it is not used and T13233 is already in should_fail
* Corrected typoAriFordsham2021-06-161-1/+1
|
* Reword: representation instead of levitysheaf2021-06-105-27/+43
| | | | fixes #19756, updates haddock submodule
* User's Guide: reword and fix punctuation in description of PostfixOperatorsLi-yao Xia2021-06-101-3/+3
|
* Fix incorrect mention of -Wprepositive-qualified-syntax in docsThomas Winant2021-06-041-3/+1
| | | | | | | | The flag is called `-Wprepositive-qualified-module`, not `-Wprepositive-qualified-syntax`. Use the `:ghc-flag:` syntax, which would have caught the mistake in the first place.
* Document release when TypeApplications allowed declaring variables as inferredBoris Lykah2021-05-281-2/+3
|
* 19079 DerivingVia: incorrectly accepts deriving via types with differing ↵Sasha Bogicevic2021-04-271-3/+5
| | | | runtime representations
* users-guide: Add missing FieldSelectors to GHC2021 listBen Gamari2021-04-181-0/+1
|
* users guide: Sort lists of implied language extensionsBen Gamari2021-04-181-20/+20
|
* users-guide: Clarify GHC2021 documentationBen Gamari2021-04-181-1/+7
| | | | | Point out that GHC2021 doesn't offer the same degree of stability that Haskell2010 does, as noted by @phadej.
* users-guide: Correct markdown for ghc-9.2Takenobu Tani2021-03-301-1/+1
| | | | | | This patch corrects some markdown. [skip ci]
* More improvement to MonoLocalBinds documentationSimon Peyton Jones2021-03-231-50/+35
|
* Document how GADT patterns are matched from left-to-right, outside-inRyan Scott2021-03-171-1/+82
| | | | | | | | | | | | | | This adds some bullet points to the GHC User's Guide section on `GADTs` to explain some subtleties in how GHC typechecks GADT patterns. In particular, this adds examples of programs being rejected for matching on GADTs in a way that does not mesh with GHC's left-to-right, outside-in order for checking patterns, which can result in programs being rejected for seemingly counterintuitive reasons. (See #12018 for examples of confusion that arose from this.) In addition, now that we have visible type application in data constructor patterns, I mention a possible workaround of using `TypeApplications` to repair programs of this sort. Resolves #12018.
* Document the interaction between ScopedTypeVariables and ↵Ryan Scott2021-03-151-0/+31
| | | | | | | | | StandaloneKindSignatures This documents a limitation of `StandaloneKindSignatures`—namely, that it does not bring type variables bound by an outermost `forall` into scope over a type-level declaration—in the GHC User's Guide. See #19498 for more discussion.
* Implement the UnliftedDatatypes extensionSebastian Graf2021-03-141-4/+94
| | | | | | | | | | | | | | | | | | GHC Proposal: 0265-unlifted-datatypes.rst Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265 Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523 Implementation Details: Note [Implementation of UnliftedDatatypes] This patch introduces the `UnliftedDatatypes` extension. When this extension is enabled, GHC relaxes the restrictions around what result kinds are allowed in data declarations. This allows data types for which an unlifted or levity-polymorphic result kind is inferred. The most significant changes are in `GHC.Tc.TyCl`, where `Note [Implementation of UnliftedDatatypes]` describes the details of the implementation. Fixes #19523.
* Introduce GHC2021 languageJoachim Breitner2021-03-101-0/+64
| | | | | | This adds support for -XGHC2021, as described in Proposal 0380 [1]. [1] https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst
* Document operator sections' interaction with subsumptionRyan Scott2021-03-091-0/+4
| | | | | | This resolves #19457 by making a note of breaking changes (introduced in GHC 9.2) to the way that GHC typechecks operator sections where the operator has nested `forall`s or contexts in its type signature.
* Implement BoxedRep proposalwip/boxed-repBen Gamari2021-03-072-9/+13
| | | | | | | | | | | | | | | | | | | | | | | This implements the BoxedRep proposal, refactoring the `RuntimeRep` hierarchy from: ```haskell data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ... ``` to ```haskell data RuntimeRep = BoxedRep Levity | ... data Levity = Lifted | Unlifted ``` Updates binary, haddock submodules. Closes #17526. Metric Increase: T12545
* Implement record dot syntaxwip/joachim/bump-haddockShayne Fletcher2021-03-064-3/+99
|
* Bring back COMPLETE sets filtered by result TyCon (#14422)Cale Gibbard2021-03-041-0/+53
| | | | | | | | | | | | | | | | | | | Commit 2a94228 dramatically simplified the implementation and improved the performance of COMPLETE sets while making them applicable in more scenarios at the same time. But it turned out that there was a change in semantics that (to me unexpectedly) broke users' expectations (see #14422): They relied on the "type signature" of a COMPLETE pragma to restrict the scrutinee types of a pattern match for which they are applicable. This patch brings back that filtering, so the semantics is the same as it was in GHC 9.0. See the updated Note [Implementation of COMPLETE pragmas]. There are a few testsuite output changes (`completesig13`, `T14422`) which assert this change. Co-authored-by: Sebastian Graf <sebastian.graf@kit.edu>
* User's Guide: document DefaultSignatures' interaction with subsumptionRyan Scott2021-03-031-25/+118
| | | | | | | | | | As reported in #19432, the rules governing how `DefaultSignatures` are typechecked became stricter in GHC 9.0 due to simplified subsumption. However, this was far from obvious to me after reading the User's Guide section on `DefaultSignatures`. In this patch, I spruce up the documentation in that section so that it mentions these nuances. Resolves #19432.
* Infer multiplicity in case expressionsKrzysztof Gogolewski2021-03-011-4/+5
| | | | This is a first step towards #18738.
* Implement -Wambiguous-fieldsAdam Gundry2021-02-261-5/+19
| | | | | | Fixes #18966. Adds a new warning -Wambiguous-fields for uses of field selectors or record updates that will be rejected in the future, when the DuplicateRecordFields extension is simplified per https://github.com/ghc-proposals/ghc-proposals/pull/366.
* Update MonoLocalBinds documentationSimon Peyton Jones2021-02-262-11/+28
| | | | | | | | | Update the documentation to specify that MonoLocalBinds is lifted by a partial type signature. This came up in #19396. [skip ci]
* Minor fix to QualifiedDo docs about the ApplicativeDo desugaringUtku Demir2021-02-251-3/+3
| | | | | | | | | When desugaring ApplicativeDo, GHC looks up the name `fmap`, not `<$>` (see 'GHC.Builtin.Names.fmapName'). This commit fixes the misleading documentation; since exporting the name `<$>` instead of `fmap` causes a "not in scope" error when `QualifiedDo` and `ApplicativeDo` is combined. [skip ci]
* Implement NoFieldSelectors extension (ghc-proposals 160)Adam Gundry2021-02-166-4/+134
| | | | | | | | | | | | | | | | | | | | | Fixes #5972. This adds an extension NoFieldSelectors to disable the generation of selector functions corresponding to record fields. When this extension is enabled, record field selectors are not accessible as functions, but users are still able to use them for record construction, pattern matching and updates. See Note [NoFieldSelectors] in GHC.Rename.Env for details. Defining the same field multiple times requires the DuplicateRecordFields extension to be enabled, even when NoFieldSelectors is in use. Along the way, this fixes the use of non-imported DuplicateRecordFields in GHCi with -fimplicit-import-qualified (fixes #18729). Moreover, it extends DisambiguateRecordFields to ignore non-fields when looking up fields in record updates (fixes #18999), as described by Note [DisambiguateRecordFields for updates]. Co-authored-by: Simon Hafner <hafnersimon@gmail.com> Co-authored-by: Fumiaki Kinoshita <fumiexcel@gmail.com>
* Fix example code in Deriving via. songzh2021-02-131-1/+1
|
* Fix example code of "Making a Haskell library that can be called from ↵Masahiro Sakai2021-02-101-2/+2
| | | | | | | foreign code" section "+RTS" in argv[0] is interpreted as a program name and does not work as an indicator of RTS options.
* The Char kind (#11342)Daniel Rogozin2021-02-061-6/+4
| | | | | | | | | | | | | | | | | | | | | | 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-305-34/+8
| | | | | | | | | | | | | | | - 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 code formatting in `HasCallStack` sectionDenis Frezzato2021-01-281-1/+1
|
* Remove some redundant validity checks.Richard Eisenberg2021-01-277-144/+26
| | | | | | | | | | | | 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}