summaryrefslogtreecommitdiff
path: root/docs/users_guide
Commit message (Collapse)AuthorAgeFilesLines
* Eventlog: Document the fact timestamps are nanosecondswip/eventlog-docsMatthew Pickering2019-05-301-0/+4
| | | | [skip ci]
* Fix some warnings in users_guide (incl #16640)Oleg Grenrus2019-05-293-3/+11
| | | | | | | | | | | | | | - short underline - :ghc-flag:, not :ghc-flags: - :since: have to be separate - newline before code block - workaround anchor generation so - pragma:SPECIALISE - pragma:SPECIALIZE-INLINE - pragma:SPECIALIZE-inline are different anchors, not all the same `pragma:SPECIALIZE`
* Remove stale 8.2.1-notesOleg Grenrus2019-05-291-527/+0
|
* Minor spelling fixes to users guide.P.C. Shyamshankar2019-05-298-8/+8
|
* Correct the large tuples section in user's guideJoshua Price2019-05-271-8/+8
| | | | Fixes #16644.
* Use HsTyPats in associated type family defaultsRyan Scott2019-05-222-13/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Associated type family default declarations behave strangely in a couple of ways: 1. If one tries to bind the type variables with an explicit `forall`, the `forall`'d part will simply be ignored. (#16110) 2. One cannot use visible kind application syntax on the left-hand sides of associated default equations, unlike every other form of type family equation. (#16356) Both of these issues have a common solution. Instead of using `LHsQTyVars` to represent the left-hand side arguments of an associated default equation, we instead use `HsTyPats`, which is what other forms of type family equations use. In particular, here are some highlights of this patch: * `FamEqn` is no longer parameterized by a `pats` type variable, as the `feqn_pats` field is now always `HsTyPats`. * The new design for `FamEqn` in chronicled in `Note [Type family instance declarations in HsSyn]`. * `TyFamDefltEqn` now becomes the same thing as `TyFamInstEqn`. This means that many of `TyFamDefltEqn`'s code paths can now reuse the code paths for `TyFamInstEqn`, resulting in substantial simplifications to various parts of the code dealing with associated type family defaults. Fixes #16110 and #16356.
* Have GHCi use object code for UnboxedTuples modules #15454Michael Sloan2019-05-222-5/+15
| | | | | | | | | | | | The idea is to automatically enable -fobject-code for modules that use UnboxedTuples, along with all the modules they depend on. When looking into how to solve this, I was pleased to find that there was already highly similar logic for enabling code generation when -fno-code is specified but TemplateHaskell is used. The state before this patch was that if you used unboxed tuples then you had to enable `-fobject-code` globally rather than on a per module basis.
* Allow for multiple linker instances. Fixes Haskell portion of #3372.Julian Leviston2019-05-211-0/+4
|
* users-guide: Fix -rtsopts defaultKirill Elagin2019-05-211-1/+1
|
* Include CPP preprocessor dependencies in -M outputDavid Eichmann2019-05-211-0/+14
| | | | Issue #16521
* users-guide: Fix directive errors on 8.10Takenobu Tani2019-05-211-2/+4
| | | | | | | | | | | The following sections are not displayed due to a directive error: * -Wunused-record-wildcards * -Wredundant-record-wildcards I changed the location of the `since` directive. [skip ci]
* Guard CUSKs behind a language pragmaVladislav Zavialov2019-05-141-0/+12
| | | | | | | | | | | | | | GHC Proposal #36 describes a transition plan away from CUSKs and to top-level kind signatures: 1. Introduce a new extension, -XCUSKs, on by default, that detects CUSKs as they currently exist. 2. We turn off the -XCUSKs extension in a few releases and remove it sometime thereafter. This patch implements phase 1 of this plan, introducing a new language extension to control whether CUSKs are enabled. When top-level kind signatures are implemented, we can transition to phase 2.
* Fix bugs and documentation for #13456Roland Senn2019-05-101-1/+4
|
* Implement ImportQualifiedPostShayne Fletcher2019-05-081-0/+32
|
* Fix #16603 by documenting some important changes in changelogsRyan Scott2019-05-081-0/+43
| | | | | | This addresses some glaring omissions from `libraries/base/changelog.md` and `docs/users_guide/8.8.1-notes.rst`, fixing #16603 in the process.
* Fix #16593 by having only one definition of -fprint-explicit-runtime-repsChaitanya Koparkar2019-05-052-23/+11
| | | | [skip ci]
* Fix typo in 8.8.1 notes related to traceBinaryEventiustin2019-05-041-2/+3
| | | | - fixes double mention of `traceBinaryEvent#` (the second one should be `traceEvent#`, I think) - fixes note about `traceEvent#` taking a `String` - the docs say it takes a zero-terminated ByteString.
* Make equality constraints in kinds invisibleRyan Scott2019-05-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issues #12102 and #15872 revealed something strange about the way GHC handles equality constraints in kinds: it treats them as _visible_ arguments! This causes a litany of strange effects, from strange error messages (https://gitlab.haskell.org/ghc/ghc/issues/12102#note_169035) to bizarre `Eq#`-related things leaking through to GHCi output, even without any special flags enabled. This patch is an attempt to contain some of this strangeness. In particular: * In `TcHsType.etaExpandAlgTyCon`, we propagate through the `AnonArgFlag`s of any `Anon` binders. Previously, we were always hard-coding them to `VisArg`, which meant that invisible binders (like those whose kinds were equality constraint) would mistakenly get flagged as visible. * In `ToIface.toIfaceAppArgsX`, we previously assumed that the argument to a `FunTy` always corresponding to a `Required` argument. We now dispatch on the `FunTy`'s `AnonArgFlag` and map `VisArg` to `Required` and `InvisArg` to `Inferred`. As a consequence, the iface pretty-printer correctly recognizes that equality coercions are inferred arguments, and as a result, only displays them in `-fprint-explicit-kinds` is enabled. * Speaking of iface pretty-printing, `Anon InvisArg` binders were previously being pretty-printed like `T (a :: b ~ c)`, as if they were required. This seemed inconsistent with other invisible arguments (that are printed like `T @{d}`), so I decided to switch this to `T @{a :: b ~ c}`. Along the way, I also cleaned up a minor inaccuracy in the users' guide section for constraints in kinds that was spotted in https://gitlab.haskell.org/ghc/ghc/issues/12102#note_136220. Fixes #12102 and #15872.
* users-guide: Add libraries section to 8.10.1 release notesBen Gamari2019-04-211-0/+40
|
* users-guide: Add pretty to package listBen Gamari2019-04-211-0/+1
|
* TH: make `Lift` and `TExp` levity-polymorphicAlec Theriault2019-04-182-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides the obvious benefits of being able to manipulate `TExp`'s of unboxed types, this also simplified `-XDeriveLift` all while making it more capable. * `ghc-prim` is explicitly depended upon by `template-haskell` * The following TH things are parametrized over `RuntimeRep`: - `TExp(..)` - `unTypeQ` - `unsafeTExpCoerce` - `Lift(..)` * The following instances have been added to `Lift`: - `Int#`, `Word#`, `Float#`, `Double#`, `Char#`, `Addr#` - unboxed tuples of lifted types up to arity 7 - unboxed sums of lifted types up to arity 7 Ideally we would have levity-polymorphic _instances_ of unboxed tuples and sums. * The code generated by `-XDeriveLift` uses expression quotes instead of generating large amounts of TH code and having special hard-coded cases for some unboxed types.
* users-guide: document :set local-configFraser Tweedale2019-04-151-0/+17
| | | | | | | | Document the ':set local-config' command and add a warning about sourcing untrusted local .ghci scripts. Related: https://gitlab.haskell.org/ghc/ghc/issues/6017 Related: https://gitlab.haskell.org/ghc/ghc/issues/14250
* users-guide: update startup script orderFraser Tweedale2019-04-151-8/+8
| | | | | | | | Update users guide to match the new startup script order. Also clarify that -ignore-dot-ghci does not apply to scripts specified via the -ghci-script option. Part of: https://gitlab.haskell.org/ghc/ghc/issues/14689
* Apply suggestion to docs/users_guide/using-optimisation.rstGiles Anderson2019-04-151-1/+1
|
* Document how -O3 is handled by GHCGiles Anderson2019-04-151-0/+11
| | | | | -O2 is the highest value of optimization. -O3 will be reverted to -O2.
* docs: mention memcpy optimization for ByteArrays in 8.10.1-notesArtem Pyanykh2019-04-141-4/+5
|
* Add -ddump-stg-final to dump stg as it is used for codegen.klebinger.andreas@gmx.at2019-04-121-0/+5
| | | | | Intermediate STG does not contain free variables which can be useful sometimes. So adding a flag to dump that info.
* docs: add a note about changes in memset unrolling to 8.10.1-notesArtem Pyanykh2019-04-091-0/+5
|
* users-guide: Document how to disable package environmentsBen Gamari2019-04-091-2/+8
| | | | As noted in #16309 this somehow went undocumented.
* Add `-optcxx` option (#16477)Yuriy Syrovetskiy2019-04-081-0/+7
|
* Fix #16500: look for interface files in -hidir flag in OneShot modePhuong Trinh2019-04-081-0/+11
| | | | | | | | | | | We are currently ignoring options set in the hiDir field of hsc_dflags when looking for interface files while compiling in OneShot mode. This is inconsistent with the behaviour of other directory redirecting fields (such as objectDir or hieDir). It is also inconsistent with the behaviour of compilation in CompManager mode (a.k.a `ghc --make`) which looks for interface files in the directory set in hidir flag. This changes Finder.hs so that we use the value of hiDir while looking for interface in OneShot mode.
* Correct two misspellings of "separately"Chris Martin2019-04-031-1/+1
|
* users-guide: Typo in Users Guide, Glasgow ExtsFrank Steffahn2019-04-031-1/+1
|
* users-guide: Fix typoNathan Collins2019-04-031-1/+1
|
* Add support for bitreverse primopAlexandre2019-04-011-0/+4
| | | | | | This commit includes the necessary changes in code and documentation to support a primop that reverses a word's bits. It also includes a test.
* docs: make nfib compute the Fibonacci sequence [skipci]Artem Pelenitsyn2019-03-291-1/+1
|
* User's Guide: extensions compatibilityHaskell-mouse2019-03-251-0/+18
| | | | | | | Adds the mention that extensions "AllowAmbiguousTypes" and "RankNTypes" are not always compatible with each other. Specifies the conditions and causes of failing in resolving of ambiguity.
* users-guide: Update Wiki URLs to point to GitLabTakenobu Tani2019-03-1913-30/+28
| | | | | | | | | | The user's guide uses the `ghc-wiki` macro, and substitution rules are complicated. So I manually edited `.rst` files without sed. I changed `Commentary/Latedmd` only to a different page. It is more appropriate as an example. [ci skip]
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-155-13/+13
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Rip out object splittingBen Gamari2019-03-053-20/+8
| | | | | | | | | | | | | | | The splitter is an evil Perl script that processes assembler code. Its job can be done better by the linker's --gc-sections flag. GHC passes this flag to the linker whenever -split-sections is passed on the command line. This is based on @DemiMarie's D2768. Fixes Trac #11315 Fixes Trac #9832 Fixes Trac #8964 Fixes Trac #8685 Fixes Trac #8629
* Visible dependent quantificationRyan Scott2019-03-013-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements GHC proposal 35 (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0035-forall-arrow.rst) by adding the ability to write kinds with visible dependent quantification (VDQ). Most of the work for supporting VDQ was actually done _before_ this patch. That is, GHC has been able to reason about kinds with VDQ for some time, but it lacked the ability to let programmers directly write these kinds in the source syntax. This patch is primarly about exposing this ability, by: * Changing `HsForAllTy` to add an additional field of type `ForallVisFlag` to distinguish between invisible `forall`s (i.e, with dots) and visible `forall`s (i.e., with arrows) * Changing `Parser.y` accordingly The rest of the patch mostly concerns adding validity checking to ensure that VDQ is never used in the type of a term (as permitting this would require full-spectrum dependent types). This is accomplished by: * Adding a `vdqAllowed` predicate to `TcValidity`. * Introducing `splitLHsSigmaTyInvis`, a variant of `splitLHsSigmaTy` that only splits invisible `forall`s. This function is used in certain places (e.g., in instance declarations) to ensure that GHC doesn't try to split visible `forall`s (e.g., if it tried splitting `instance forall a -> Show (Blah a)`, then GHC would mistakenly allow that declaration!) This also updates Template Haskell by introducing a new `ForallVisT` constructor to `Type`. Fixes #16326. Also fixes #15658 by documenting this feature in the users' guide.
* Cleanup iserv/iserv-proxyMoritz Angermann2019-02-281-0/+32
| | | | | | | | | | | | This adds trace messages that include the processes name and as such make debugging and following the communication easier. It also adds a note regarding the fwd*Call proxy-communication logic between the proxy and the slave. The proxy will now also poll for 60s to wait for the remote iserv to come up. (Alternatively you can start the remote process beforehand; and just have iserv-proxy connect to it)
* Treat kind/type variables identically, demolish FKTVVladislav Zavialov2019-02-273-88/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements GHC Proposal #24: .../ghc-proposals/blob/master/proposals/0024-no-kind-vars.rst Fixes Trac #16334, Trac #16315 With this patch, scoping rules for type and kind variables have been unified: kind variables no longer receieve special treatment. This simplifies both the language and the implementation. User-facing changes ------------------- * Kind variables are no longer implicitly quantified when an explicit forall is used: p :: Proxy (a :: k) -- still accepted p :: forall k a. Proxy (a :: k) -- still accepted p :: forall a. Proxy (a :: k) -- no longer accepted In other words, now we adhere to the "forall-or-nothing" rule more strictly. Related function: RnTypes.rnImplicitBndrs * The -Wimplicit-kind-vars warning has been deprecated. * Kind variables are no longer implicitly quantified in constructor declarations: data T a = T1 (S (a :: k) | forall (b::k). T2 (S b) -- no longer accepted data T (a :: k) = T1 (S (a :: k) | forall (b::k). T2 (S b) -- still accepted Related function: RnTypes.extractRdrKindSigVars * Implicitly quantified kind variables are no longer put in front of other variables: f :: Proxy (a :: k) -> Proxy (b :: j) f :: forall k j (a :: k) (b :: j). Proxy a -> Proxy b -- old order f :: forall k (a :: k) j (b :: j). Proxy a -> Proxy b -- new order This is a breaking change for users of TypeApplications. Note that we still respect the dpendency order: 'k' before 'a', 'j' before 'b'. See "Ordering of specified variables" in the User's Guide. Related function: RnTypes.rnImplicitBndrs * In type synonyms and type family equations, free variables on the RHS are no longer implicitly quantified unless used in an outermost kind annotation: type T = Just (Nothing :: Maybe a) -- no longer accepted type T = Just Nothing :: Maybe (Maybe a) -- still accepted The latter form is a workaround due to temporary lack of an explicit quantification method. Ideally, we would write something along these lines: type T @a = Just (Nothing :: Maybe a) Related function: RnTypes.extractHsTyRdrTyVarsKindVars * Named wildcards in kinds are fixed (Trac #16334): x :: (Int :: _t) -- this compiles, infers (_t ~ Type) Related function: RnTypes.partition_nwcs Implementation notes -------------------- * One of the key changes is the removal of FKTV in RnTypes: - data FreeKiTyVars = FKTV { fktv_kis :: [Located RdrName] - , fktv_tys :: [Located RdrName] } + type FreeKiTyVars = [Located RdrName] We used to keep track of type and kind variables separately, but now that they are on equal footing when it comes to scoping, we can put them in the same list. * extract_lty and family are no longer parametrized by TypeOrKind, as we now do not distinguish kind variables from type variables. * PatSynExPE and the related Note [Pattern synonym existentials do not scope] have been removed (Trac #16315). With no implicit kind quantification, we can no longer trigger the error. * reportFloatingKvs and the related Note [Free-floating kind vars] have been removed. With no implicit kind quantification, we can no longer trigger the error.
* User's Guide: forall is a keyword nowadaysVladislav Zavialov2019-02-232-6/+11
|
* User's Guide: update info on kind inferenceVladislav Zavialov2019-02-231-18/+18
| | | | | | | We no longer put class variables in front, see "Taming the Kind Inference Monster" (also fix some markup issues)
* Add AnonArgFlag to FunTySimon Peyton Jones2019-02-231-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The big payload of this patch is: Add an AnonArgFlag to the FunTy constructor of Type, so that (FunTy VisArg t1 t2) means (t1 -> t2) (FunTy InvisArg t1 t2) means (t1 => t2) The big payoff is that we have a simple, local test to make when decomposing a type, leading to many fewer calls to isPredTy. To me the code seems a lot tidier, and probably more efficient (isPredTy has to take the kind of the type). See Note [Function types] in TyCoRep. There are lots of consequences * I made FunTy into a record, so that it'll be easier when we add a linearity field, something that is coming down the road. * Lots of code gets touched in a routine way, simply because it pattern matches on FunTy. * I wanted to make a pattern synonym for (FunTy2 arg res), which picks out just the argument and result type from the record. But alas the pattern-match overlap checker has a heart attack, and either reports false positives, or takes too long. In the end I gave up on pattern synonyms. There's some commented-out code in TyCoRep that shows what I wanted to do. * Much more clarity about predicate types, constraint types and (in particular) equality constraints in kinds. See TyCoRep Note [Types for coercions, predicates, and evidence] and Note [Constraints in kinds]. This made me realise that we need an AnonArgFlag on AnonTCB in a TyConBinder, something that was really plain wrong before. See TyCon Note [AnonTCB InivsArg] * When building function types we must know whether we need VisArg (mkVisFunTy) or InvisArg (mkInvisFunTy). This turned out to be pretty easy in practice. * Pretty-printing of types, esp in IfaceType, gets tidier, because we were already recording the (->) vs (=>) distinction in an ad-hoc way. Death to IfaceFunTy. * mkLamType needs to keep track of whether it is building (t1 -> t2) or (t1 => t2). See Type Note [mkLamType: dictionary arguments] Other minor stuff * Some tidy-up in validity checking involving constraints; Trac #16263
* '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