1. 20 Mar, 2019 1 commit
    • Takenobu Tani's avatar
      users-guide: Update Wiki URLs to point to GitLab · 89a201e8
      Takenobu Tani authored
      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]
      89a201e8
  2. 15 Mar, 2019 1 commit
  3. 06 Mar, 2019 1 commit
    • Ben Gamari's avatar
      Rip out object splitting · 37f257af
      Ben Gamari authored
      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
      37f257af
  4. 01 Mar, 2019 1 commit
    • Ryan Scott's avatar
      Visible dependent quantification · c26d299d
      Ryan Scott authored
      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.
      c26d299d
  5. 28 Feb, 2019 1 commit
    • Moritz Angermann's avatar
      Cleanup iserv/iserv-proxy · f838809f
      Moritz Angermann authored
      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)
      f838809f
  6. 27 Feb, 2019 1 commit
    • Vladislav Zavialov's avatar
      Treat kind/type variables identically, demolish FKTV · 5bc195b1
      Vladislav Zavialov authored
      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.
      5bc195b1
  7. 24 Feb, 2019 3 commits
    • Vladislav Zavialov's avatar
      ae7d1ff6
    • Vladislav Zavialov's avatar
      User's Guide: update info on kind inference · 88970187
      Vladislav Zavialov authored
      We no longer put class variables in front,
      see "Taming the Kind Inference Monster"
      
      (also fix some markup issues)
      88970187
    • Simon Peyton Jones's avatar
      Add AnonArgFlag to FunTy · 6cce36f8
      Simon Peyton Jones authored
      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
      6cce36f8
  8. 15 Feb, 2019 1 commit
  9. 14 Feb, 2019 2 commits
    • Matthew Pickering's avatar
      Implement -Wredundant-record-wildcards and -Wunused-record-wildcards · 19626218
      Matthew Pickering authored
      -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`.
      19626218
    • Sylvain Henry's avatar
      NCG: fast compilation of very large strings (#16190) · 1d9a1d9f
      Sylvain Henry authored
      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.
      1d9a1d9f
  10. 08 Feb, 2019 1 commit
  11. 04 Feb, 2019 1 commit
  12. 03 Feb, 2019 1 commit
  13. 31 Jan, 2019 1 commit
    • Zejun Wu's avatar
      Add -fdefer-diagnostics to defer and group diagnostic messages in make-mode · 0593e938
      Zejun Wu authored
      When loading many modules in parallel there can a lot of warnings and
      errors get mixed up with regular output. When the compilation fails,
      the relevant error message can be thousands of lines backward and is
      hard to find. When the compilation successes, warning message is likely
      to be ignored as it is not seen. We can address this by deferring the
      warning and error message after the compilation. We also put errors
      after warnings so it is more visible.
      
      This idea was originally proposed by Bartosz Nitka in
      https://phabricator.haskell.org/D4219.
      0593e938
  14. 30 Jan, 2019 5 commits
    • Zejun Wu's avatar
      Add a RTS option -xp to load PIC object anywhere in address space · e29b1ee7
      Zejun Wu authored
      Summary:
      This re-applies {D5195} with fixes for i386:
      * Fix unused label warnings, see {D5230} or {D5273}
      * Fix a silly bug introduced by moving `#if`
      
      {P190}
      
      Add a RTS option -xp to load PIC object anywhere in address space. We do
      this by relaxing the requirement of <0x80000000 result of
      `mmapForLinker` and implying USE_CONTIGUOUS_MMAP.
      
      We also need to change calls to `ocInit` and `ocGetNames` to avoid
      dangling pointers when the address of `oc->image` is changed by
      `ocAllocateSymbolExtra`.
      
      Test Plan:
      See {D5195}, also test under i386:
      
      ```
      $ uname -a
      Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28
      20:45:30 CEST 2018 i686 GNU/Linux
      $ cd testsuite/tests/th/ && make test
      ...
      ```
      
      will run `./validate` on stacked diff.
      
      Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5289
      e29b1ee7
    • Alec Theriault's avatar
      Include type info for only some exprs in HIE files · 5ed48d25
      Alec Theriault authored
      This commit relinquishes some some type information in `.hie` files in
      exchange for better performance. See #16233 for more on this.
      
      Using `.hie` files to generate hyperlinked sources is a crucial milestone
      towards Hi Haddock (the initiative to move Haddock to work over `.hi`
      files and embed docstrings in those). Unfortunately, even after much
      optimization on the Haddock side, the `.hie` based solution is still
      considerably slower and more memory hungry than the existing implementation
      - and the @.hie@ code is to blame.
      
      This changes `.hie` file generation to track type information for only
      a limited subset of expressions (specifically, those that might eventually
      turn into hyperlinks in the Haddock's hyperlinker backend).
      5ed48d25
    • Dmitry Ivanov's avatar
      Compile count{Leading,Trailing}Zeros to corresponding x86_64 instructions under -mbmi2 · c1d9416f
      Dmitry Ivanov authored
      This works similarly to existing implementation for popCount.
      Trac ticket: #16086.
      c1d9416f
    • Ben Gamari's avatar
      Revert "Batch merge" · 172a5933
      Ben Gamari authored
      This reverts commit 76c8fd67.
      172a5933
    • Ben Gamari's avatar
      Batch merge · 76c8fd67
      Ben Gamari authored
      76c8fd67
  15. 23 Jan, 2019 3 commits
  16. 16 Jan, 2019 1 commit
    • Ben Price's avatar
      doc: behaviour of +RTS -h depends on profiling · 6acb36d8
      Ben Price authored
      The rts option `-h` behaves as `-hT` when compiled without profiling,
      and `-hc` when compiled with profiling. Add a note to the user's guide
      highlighting this inconsistency.
      6acb36d8
  17. 06 Jan, 2019 1 commit
  18. 05 Jan, 2019 1 commit
  19. 03 Jan, 2019 2 commits
    • My Nguyen's avatar
      Visible kind application · 17bd1635
      My Nguyen authored
      Summary:
      This patch implements visible kind application (GHC Proposal 15/#12045), as well as #15360 and #15362.
      It also refactors unnamed wildcard handling, and requires that type equations in type families in Template Haskell be
      written with full type on lhs. PartialTypeSignatures are on and warnings are off automatically with visible kind
      application, just like in term-level.
      
      There are a few remaining issues with this patch, as documented in
      ticket #16082.
      
      Includes a submodule update for Haddock.
      
      Test Plan: Tests T12045a/b/c/TH1/TH2, T15362, T15592a
      
      Reviewers: simonpj, goldfire, bgamari, alanz, RyanGlScott, Iceland_jack
      
      Subscribers: ningning, Iceland_jack, RyanGlScott, int-index, rwbarton, mpickering, carter
      
      GHC Trac Issues: `#12045`, `#15362`, `#15592`, `#15788`, `#15793`, `#15795`, `#15797`, `#15799`, `#15801`, `#15807`, `#15816`
      
      Differential Revision: https://phabricator.haskell.org/D5229
      17bd1635
    • Takenobu Tani's avatar
      stg-spec: Modify `.lhs` to `.hs` · 05cd2319
      Takenobu Tani authored
      Modify old filename `.lhs` to `.hs` in the following file:
      
        * docs/stg-spec/StgSyn.ott
      
      Since PDF has not been registered in the past, I have not committed generated PDF(`stg-spec.pdf`).
      
      [ci skip]
      05cd2319
  20. 02 Jan, 2019 2 commits
  21. 01 Jan, 2019 1 commit
  22. 21 Dec, 2018 1 commit
  23. 15 Dec, 2018 1 commit
    • Ben Gamari's avatar
      Use https links in user-facing startup and error messages · a1c0b706
      Ben Gamari authored
      I consider myself lucky that in my circle of friends, `http` urls (as
      opposed to `https` urls) are frowned upon in that we generally
      apologize in the rase cases that we share an `http` url.
      
      This pull request changes `http` links into their `https` analogues in
      the following places:
      
      * In the GHCI startup message (and parts of the User's Guide, where
      there are verbatim transcripts of GHCi sessions).
      * In a couple of error messages, asking the user to report a bug.
      
      (I also took the liberty to change a single space before the reportabug
      url into two spaces, harmonizing this occurence with the others.)
      
      I'm not trying to start a war. I just had a moment to spare and felt
      like preparing this diff. Merge or don't merge as you wish!
      
      Reviewers: bgamari, erikd, simonmar
      
      Subscribers: goldfire, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5450
      a1c0b706
  24. 13 Dec, 2018 1 commit
    • Daniel Gröber (dxld)'s avatar
      Fix recompilation checking of pure plugins · efb6a30f
      Daniel Gröber (dxld) authored
      Previously when switching from using a Plugin with
      `RecompMaybe`/`ForceRecompile` in `pluginRecompile` to a Plugin with
      `NoForceRecompile` GHC would never even consider recompiling.
      
      However the previously active plugin could have modified the
      compilation output so we should recompile.
      
      Test Plan: validate
      
      Reviewers: bgamari, mpickering
      
      Subscribers: mpickering, rwbarton, carter
      
      GHC Trac Issues: #15858
      
      Differential Revision: https://phabricator.haskell.org/D5299
      efb6a30f
  25. 11 Dec, 2018 3 commits
    • Shayne Fletcher's avatar
      Enable rebindable fail with overloaded strings · 8a4edd15
      Shayne Fletcher authored
      Summary: enable rebindable fail with overloaded strings
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: simonpj, ndmitchell, rwbarton, carter
      
      GHC Trac Issues: #15645
      
      Differential Revision: https://phabricator.haskell.org/D5251
      8a4edd15
    • Alec Theriault's avatar
      Support generating HIE files · f582379d
      Alec Theriault authored
      Adds a `-fenable-ide-info` flag which instructs GHC to generate `.hie`
      files (see the wiki page:
      https://ghc.haskell.org/trac/ghc/wiki/HIEFiles).
      
      This is a rebased version of Zubin Duggal's (@wz1000) GHC changes for
      his GSOC project, as posted here:
      https://gist.github.com/wz1000/5ed4ddd0d3e96d6bc75e095cef95363d.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, gershomb, nomeata, alanz, sjakobi
      
      Reviewed By: alanz, sjakobi
      
      Subscribers: alanz, hvr, sjakobi, rwbarton, wz1000, carter
      
      Differential Revision: https://phabricator.haskell.org/D5239
      f582379d
    • awson's avatar
      RTS linker: don't crash early when not finding extra-libraries · 21339c9f
      awson authored
      Allow GHCi to not crash when no assumed DLL is found in the standard
      location.  E.g. when loading the package built "dyn" way, we may well
      have the package's DLL around, and it's the system linker which loads
      necessary dependencies.
      
      Why does this (partially) fix #11042? It's because we often (and when
      having packages built `dyn` way -- almost always) don't need to load
      anything recorded in the `extra-libraries` stanza, since if the package
      DLL exists, GHCi linker simply calls the system linker (via `dlopen`/
      `LoadLibrary` APIs) to load it and doesn't bother to load package
      prelinked object file (if any) or package static library.
      
      Thus, all "regular" (with no fancy low-level package content
      manipulation) packages built "dyn" way should be OK after this fix.
      
      Reviewers: hvr, bgamari, int-index
      
      Reviewed By: bgamari, int-index
      
      Subscribers: Phyx, int-index, rwbarton, carter
      
      GHC Trac Issues: #11042
      
      Differential Revision: https://phabricator.haskell.org/D5170
      21339c9f
  26. 08 Dec, 2018 2 commits