summaryrefslogtreecommitdiff
path: root/docs/users_guide
Commit message (Collapse)AuthorAgeFilesLines
* users guide: Document -hpcdir flagwip/hpc-docsBen Gamari2021-08-022-1/+12
| | | | Previously this was undocumented.
* 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-288-56/+62
|
* Re #18087 !6238 Empty line in front of :since:Andreas Abel2021-07-271-0/+3
| | | | Ack. @monoidal
* Issue #18087: :since: for warnings of ghc 6/7/8Andreas Abel2021-07-271-0/+113
| | | | | | | | | | | Added :since: fields to users_guide on warning, for warnings introduced starting GHC 6.0. The data was extracted from the HTML docs on warnings, see https://gitlab.haskell.org/ghc/ghc/-/issues/18087 and partially verified by consulting the change logs.
* Doc: warnings: since: remove minor version number for uniformityAndreas Abel2021-07-271-5/+5
| | | | | New warnings are only released in major versions, it seems. One way or the other, a .1 minor version can always be dropped.
* Doc: tabs to spacesAndreas Abel2021-07-271-2/+2
|
* Generalise reallyUnsafePtrEquality# and use itsheaf2021-07-231-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #9192 and #17126 updates containers submodule 1. Changes the type of the primop `reallyUnsafePtrEquality#` to the most general version possible (heterogeneous as well as levity-polymorphic): > reallyUnsafePtrEquality# > :: forall {l :: Levity} {k :: Levity} > (a :: TYPE (BoxedRep l)) (b :: TYPE (BoxedRep k)) > . a -> b -> Int# 2. Adds a new internal module, `GHC.Ext.PtrEq`, which contains pointer equality operations that are now subsumed by `reallyUnsafePtrEquality#`. These functions are then re-exported by `GHC.Exts` (so that no function goes missing from the export list of `GHC.Exts`, which is user-facing). More specifically, `GHC.Ext.PtrEq` defines: - A new function: * reallyUnsafePtrEquality :: forall (a :: Type). a -> a -> Int# - Library definitions of ex-primops: * `sameMutableArray#` * `sameSmallMutableArray` * `sameMutableByteArray#` * `sameMutableArrayArray#` * `sameMutVar#` * `sameTVar#` * `sameMVar#` * `sameIOPort#` * `eqStableName#` - New functions for comparing non-mutable arrays: * `sameArray#` * `sameSmallArray#` * `sameByteArray#` * `sameArrayArray#` These were requested in #9192. Generally speaking, existing libraries that use `reallyUnsafePtrEquality#` will continue to work with the new, levity-polymorphic version. But not all! Some (`containers`, `unordered-containers`, `dependent-map`) contain the following: > unsafeCoerce# reallyUnsafePtrEquality# a b If we make `reallyUnsafePtrEquality#` levity-polymorphic, this code fails the current GHC representation-polymorphism checks. We agreed that the right solution here is to modify the library; in this case by deleting the call to `unsafeCoerce#`, since `reallyUnsafePtrEquality#` is now type-heterogeneous too.
* Unify remaining GHCi prompt exampleEmily Martins2021-07-011-1/+1
| | | | Signed-off-by: Emily Martins <emily.flakeheart@gmail.com>
* Unify primary and secondary GHCi promptEmily Martins2021-07-011-15/+15
| | | | | | | Fixes #20042 Signed-off-by: Emily Martins <emily.flakeheart@gmail.com> Signed-off-by: Hécate Moonlight <hecate@glitchbra.in>
* Use HsExpansion for overloaded list patternssheaf2021-06-291-0/+12
| | | | Fixes #14380, #19997
* Update docs for change in parsing behaviour of infix operators like in GHC 9Zubin Duggal2021-06-281-2/+8
|
* Revert "Make reallyUnsafePtrEquality# levity-polymorphic"Matthew Pickering2021-06-271-7/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit d1f59540e8b7be96b55ab4b286539a70bc75416c. This commit breaks the build of unordered-containers ``` [3 of 9] Compiling Data.HashMap.Internal.Array ( Data/HashMap/Internal/Array.hs, dist/build/Data/HashMap/Internal/Array.o, dist/build/Data/HashMap/Internal/Array.dyn_o ) *** Parser [Data.HashMap.Internal.Array]: Parser [Data.HashMap.Internal.Array]: alloc=21043544 time=13.621 *** Renamer/typechecker [Data.HashMap.Internal.Array]: Renamer/typechecker [Data.HashMap.Internal.Array]: alloc=151218672 time=187.083 *** Desugar [Data.HashMap.Internal.Array]: ghc: panic! (the 'impossible' happened) GHC version 9.3.20210625: expectJust splitFunTy CallStack (from HasCallStack): error, called at compiler/GHC/Data/Maybe.hs:68:27 in ghc:GHC.Data.Maybe expectJust, called at compiler/GHC/Core/Type.hs:1247:14 in ghc:GHC.Core.Type ``` Revert containers submodule update
* user-guide: Improve documentation of NumDecimalsZubin Duggal2021-06-271-6/+16
|
* Make reallyUnsafePtrEquality# levity-polymorphicsheaf2021-06-251-0/+7
| | | | fixes #17126, updates containers submodule
* 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-222-2/+3
| | | | | | | | | | | | | | | | | | | - 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
* Linker/darwin: Properly honour -fno-use-rpathsMatthew Pickering2021-06-202-2/+13
| | | | | | | | | | | | | The specification is now simple * On linux, use `-Xlinker -rpath -Xlinker` to set the rpath of the executable * On darwin, never use `-Xlinker -rpath -Xlinker`, always inject the rpath afterwards, see `runInjectRPaths`. * If `-fno-use-rpaths` is passed then *never* inject anything into the rpath. Fixes #20004
* Deprecate -Wmissing-monadfail-instances (#17875)Krzysztof Gogolewski2021-06-191-41/+23
| | | | | Also document deprecation of Wnoncanonical-monadfail-instances and -Wimplicit-kind-vars
* 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
|
* Introduce `hsExprType :: HsExpr GhcTc -> Type` in the new modulewip/hsExprTypeRyan Scott2021-06-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | `GHC.Hs.Syn.Type` The existing `hsPatType`, `hsLPatType` and `hsLitType` functions have also been moved to this module This is a less ambitious take on the same problem that !2182 and !3866 attempt to solve. Rather than have the `hsExprType` function attempt to efficiently compute the `Type` of every subexpression in an `HsExpr`, this simply computes the overall `Type` of a single `HsExpr`. - Explicitly forbids the `SplicePat` `HsIPVar`, `HsBracket`, `HsRnBracketOut` and `HsTcBracketOut` constructors during the typechecking phase by using `Void` as the TTG extension field - Also introduces `dataConCantHappen` as a domain specific alternative to `absurd` to handle cases where the TTG extension points forbid a constructor. - Turns HIE file generation into a pure function that doesn't need access to the `DsM` monad to compute types, but uses `hsExprType` instead. - Computes a few more types during HIE file generation - Makes GHCi's `:set +c` command also use `hsExprType` instead of going through the desugarer to compute types. Updates haddock submodule Co-authored-by: Zubin Duggal <zubin.duggal@gmail.com>
* Make Logger independent of DynFlagsSylvain Henry2021-06-071-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce LogFlags as a independent subset of DynFlags used for logging. As a consequence in many places we don't have to pass both Logger and DynFlags anymore. The main reason for this refactoring is that I want to refactor the systools interfaces: for now many systools functions use DynFlags both to use the Logger and to fetch their parameters (e.g. ldInputs for the linker). I'm interested in refactoring the way they fetch their parameters (i.e. use dedicated XxxOpts data types instead of DynFlags) for #19877. But if I did this refactoring before refactoring the Logger, we would have duplicate parameters (e.g. ldInputs from DynFlags and linkerInputs from LinkerOpts). Hence this patch first. Some flags don't really belong to LogFlags because they are subsystem specific (e.g. most DumpFlags). For example -ddump-asm should better be passed in NCGConfig somehow. This patch doesn't fix this tight coupling: the dump flags are part of the UI but they are passed all the way down for example to infer the file name for the dumps. Because LogFlags are a subset of the DynFlags, we must update the former when the latter changes (not so often). As a consequence we now use accessors to read/write DynFlags in HscEnv instead of using `hsc_dflags` directly. In the process I've also made some subsystems less dependent on DynFlags: - CmmToAsm: by passing some missing flags via NCGConfig (see new fields in GHC.CmmToAsm.Config) - Core.Opt.*: - by passing -dinline-check value into UnfoldingOpts - by fixing some Core passes interfaces (e.g. CallArity, FloatIn) that took DynFlags argument for no good reason. - as a side-effect GHC.Core.Opt.Pipeline.doCorePass is much less convoluted.
* Make some simple primops levity-polymorphicsheaf2021-06-041-0/+19
| | | | Fixes #17817
* users-guide: Add OverloadedRecordDot and OverloadedRecordUpdate for ghc-9.2Takenobu Tani2021-06-041-0/+9
| | | | | This patch adds OverloadedRecordDot and OverloadedRecordUpdate in 9.2.1's release note.
* 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.
* Driver Rework PatchMatthew Pickering2021-06-031-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch comprises of four different but closely related ideas. The net result is fixing a large number of open issues with the driver whilst making it simpler to understand. 1. Use the hash of the source file to determine whether the source file has changed or not. This makes the recompilation checking more robust to modern build systems which are liable to copy files around changing their modification times. 2. Remove the concept of a "stable module", a stable module was one where the object file was older than the source file, and all transitive dependencies were also stable. Now we don't rely on the modification time of the source file, the notion of stability is moot. 3. Fix TH/plugin recompilation after the removal of stable modules. The TH recompilation check used to rely on stable modules. Now there is a uniform and simple way, we directly track the linkables which were loaded into the interpreter whilst compiling a module. This is an over-approximation but more robust wrt package dependencies changing. 4. Fix recompilation checking for dynamic object files. Now we actually check if the dynamic object file exists when compiling with -dynamic-too Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093
* Add -Wmissing-exported-pattern-synonym-signaturesThomas Winant2021-05-291-0/+18
| | | | | | | | | | | | | After !4741, it was no longer possible to silence a warning about a missing pattern synonym signature if the `-Wmissing-signatures` flag was on. Restore the previous semantics while still adhering to the principle "enabling an additional warning flag should never make prior warnings disappear". For more symmetry and granularity, introduce `-Wmissing-exported-pattern-synonym-signatures`. See Note [Missing signatures] for an overview of all flags involved.
* Document release when TypeApplications allowed declaring variables as inferredBoris Lykah2021-05-281-2/+3
|
* Enable strict dicts by default at -O2.Andreas Klebinger2021-05-271-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the common case this is a straight performance win at a compile time cost so we enable it at -O2. In rare cases it can lead to compile time regressions because of changed inlining behaviour. Which can very rarely also affect runtime performance. Increasing the inlining threshold can help to avoid this which is documented in the user guide. In terms of measured results this reduced instructions executed for nofib by 1%. However for some cases (e.g. Cabal) enabling this by default increases compile time by 2-3% so we enable it only at -O2 where it's clear that a user is willing to trade compile time for runtime. Most of the testsuite runs without -O2 so there are few perf changes. Increases: T12545/T18698: We perform more WW work because dicts are now treated strict. T9198: Also some more work because functions are now subject to W/W Decreases: T14697: Compiling empty modules. Probably because of changes inside ghc. T9203: I can't reproduce this improvement locally. Might be spurious. ------------------------- Metric Decrease: T12227 T14697 T9203 Metric Increase: T9198 T12545 T18698a T18698b -------------------------
* Add 9.2 release note about linear caseRichard Eisenberg2021-05-251-0/+6
| | | | | | This is part of #18738 [skip ci]
* base: Update Unicode data to 13.0.0Ben Gamari2021-05-111-0/+2
| | | | (cherry picked from commit d22e087f7bf74341c4468f11b4eb0273033ca931)
* Redesign withDict (formerly magicDict)Ryan Scott2021-04-292-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a more precise type signature to `magicDict` as proposed in #16646. In addition, this replaces the constant-folding rule for `magicDict` in `GHC.Core.Opt.ConstantFold` with a special case in the desugarer in `GHC.HsToCore.Expr.dsHsWrapped`. I have also renamed `magicDict` to `withDict` in light of the discussion in https://mail.haskell.org/pipermail/ghc-devs/2021-April/019833.html. All of this has the following benefits: * `withDict` is now more type safe than before. Moreover, if a user applies `withDict` at an incorrect type, the special-casing in `dsHsWrapped` will now throw an error message indicating what the user did incorrectly. * `withDict` can now work with classes that have multiple type arguments, such as `Typeable @k a`. This means that `Data.Typeable.Internal.withTypeable` can now be implemented in terms of `withDict`. * Since the special-casing for `withDict` no longer needs to match on the structure of the expression passed as an argument to `withDict`, it no longer cares about the presence or absence of `Tick`s. In effect, this obsoletes the fix for #19667. The new `T16646` test case demonstrates the new version of `withDict` in action, both in terms of `base` functions defined in terms of `withDict` as well as in terms of functions from the `reflection` and `singletons` libraries. The `T16646Fail` test case demonstrates the error message that GHC throws when `withDict` is applied incorrectly. This fixes #16646. By adding more tests for `withDict`, this also fixes #19673 as a side effect.
* 19079 DerivingVia: incorrectly accepts deriving via types with differing ↵Sasha Bogicevic2021-04-271-3/+5
| | | | runtime representations
* Introduce -ddump-verbose-inliningsBen Gamari2021-04-271-5/+10
| | | | | | | | Previously -ddump-inlinings and -dverbose-core2core used in conjunction would have the side-effect of dumping additional information about all inlinings considered by the simplifier. However, I have sometimes wanted this inlining information without the firehose of information produced by -dverbose-core2core. Introduce a new dump flag for this purpose.
* docs: add a short up-front description for -O, -n, -qn, -I and -IwAdam Sandberg Ericsson2021-04-261-10/+19
|
* users guide: Various other cleanupsBen Gamari2021-04-262-10/+26
|
* users-guide: Document deprecation of -funfolding-keeness-factorBen Gamari2021-04-263-1/+16
| | | | See #15304.
* Worker/wrapper: Consistent namesSebastian Graf2021-04-201-1/+1
|
* 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.
* Only load package environment file once when starting GHCiMatthew Pickering2021-04-181-0/+4
| | | | | | | | | | | | | | | Since d880d6b2e48268f5ed4d3eb751fe24cc833e9221 the parsing of the environment files was moved to `parseDynamicFlags`, under the assumption it was typically only called once. It turns out not to be true in GHCi and this led to continually reparsing the environment file whenever a new option was set, the options were appended to the package state and hence all packages reloaded, as it looked like the options were changed. The simplest fix seems to be a clearer specification: > Package environment files are only loaded in GHCi during initialisation. Fixes #19650
* [docs] release notes for !4729 + !3678Douglas Wilson2021-04-091-1/+33
| | | | Also includes small unrelated type fix
* Implement proposal 403: Lexer cleanupOleg Grenrus2021-04-051-0/+21
| | | | | This allows Other Numbers to be used in identifiers, and also documents other, already existing lexer divergence from Haskell Report
* Data.List specialization to []Oleg Grenrus2021-04-011-7/+2
| | | | | | | - Remove GHC.OldList - Remove Data.OldList - compat-unqualified-imports is no-op - update haddock submodule