1. 20 Sep, 2018 3 commits
  2. 19 Sep, 2018 2 commits
  3. 07 Sep, 2018 1 commit
  4. 19 Aug, 2018 1 commit
    • Ryan Scott's avatar
      Fix #15527 by pretty-printing an RdrName prefixly · fb8b2cb1
      Ryan Scott authored
      Summary:
      When `(.) @Int` is used without enabling `TypeApplications`,
      the resulting error message will pretty-print the (symbolic)
      `RdrName` `(.)`. However, it does so without parenthesizing it, which
      causes the pretty-printed expression to appear as `.@Int`. Yuck.
      
      Since the expression in a type application will always be prefix,
      we can fix this issue by using `pprPrefixOcc` instead of plain ol'
      `ppr`.
      
      Test Plan: make test TEST=T15527
      
      Reviewers: bgamari, monoidal, simonpj
      
      Reviewed By: monoidal, simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15527
      
      Differential Revision: https://phabricator.haskell.org/D5071
      
      (cherry picked from commit 5238f204)
      fb8b2cb1
  5. 06 Aug, 2018 3 commits
    • MaxGabriel's avatar
      [docs] Add missed specialisations warnings to list of those not enabled by -Wall · 8edc4b4b
      MaxGabriel authored
      Enabling `-Weverything` does enable those warnings.
      
      (cherry picked from commit b062bd10a88ea407ae91610f822f0c352909bcce)
      (cherry picked from commit 24b76d1b)
      8edc4b4b
    • Mathieu Boespflug's avatar
      docs: Fix wrong module name in hsig example · 6369aab2
      Mathieu Boespflug authored
      In the module signatures section, two modules were defined, `Str` and
      `A`, but `A` was importing `Text`, not `Str`.
      
      (cherry picked from commit 26ab3635ca342c88310321d7f310f1c12c23ec4c)
      (cherry picked from commit ce9b459d)
      6369aab2
    • Herbert Valerio Riedel's avatar
      Turn on MonadFail desugaring by default · 26b6ffb3
      Herbert Valerio Riedel authored
      This contains two commits:
      
      ----
      
      Make GHC's code-base compatible w/ `MonadFail`
      
      There were a couple of use-sites which implicitly used pattern-matches
      in `do`-notation even though the underlying `Monad` didn't explicitly
      support `fail`
      
      This refactoring turns those use-sites into explicit case
      discrimations and adds an `MonadFail` instance for `UniqSM`
      (`UniqSM` was the worst offender so this has been postponed for a
      follow-up refactoring)
      
      ---
      
      Turn on MonadFail desugaring by default
      
      This finally implements the phase scheduled for GHC 8.6 according to
      
      https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail#Transitiona
      lstrategy
      
      This also preserves some tests that assumed MonadFail desugaring to be
      active; all ghc boot libs were already made compatible with this
      `MonadFail` long ago, so no changes were needed there.
      
      Test Plan: Locally performed ./validate --fast
      
      Reviewers: bgamari, simonmar, jrtc27, RyanGlScott
      
      Reviewed By: bgamari
      
      Subscribers: bgamari, RyanGlScott, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D5028
      26b6ffb3
  6. 30 Jul, 2018 1 commit
  7. 16 Jul, 2018 2 commits
    • Vladislav Zavialov's avatar
      Do not imply NoStarIsType by TypeOperators/TypeInType · bb5aa616
      Vladislav Zavialov authored
      Implementation of the "Embrace TypeInType" proposal was done according
      to the spec, which specified that TypeOperators must imply NoStarIsType.
      This implication was meant to prevent breakage and to be removed in 2
      releases.  However, compiling head.hackage has shown that this
      implication only magnified the breakage, so there is no reason to have
      it in the first place.
      
      To remain in compliance with the three-release policy, we add a
      workaround to define the (*) type operator even when -XStarIsType is on.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, RyanGlScott, goldfire, phadej, hvr
      
      Reviewed By: bgamari, RyanGlScott
      
      Subscribers: harpocrates, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4865
      
      (cherry picked from commit 65c186f0)
      bb5aa616
    • Ben Gamari's avatar
      Revert "Do not imply NoStarIsType by TypeOperators/TypeInType" · c6774421
      Ben Gamari authored
      This reverts commit abd66223.
      c6774421
  8. 12 Jul, 2018 1 commit
    • Matthew Pickering's avatar
      Run the renamed source plugin after each HsGroup · b52cfe41
      Matthew Pickering authored
      This allows modification of each `HsGroup` after it has been renamed.
      
      The old behaviour of keeping the renamed source until later can be
      recovered if desired by using the `keepRenamedSource` plugin but it
      shouldn't really be necessary as it can be inspected in the `TcGblEnv`.
      
      Reviewers: nboldi, bgamari, alpmestan
      
      Reviewed By: nboldi, alpmestan
      
      Subscribers: alpmestan, rwbarton, thomie, carter
      
      GHC Trac Issues: #15315
      
      Differential Revision: https://phabricator.haskell.org/D4947
      
      (cherry picked from commit 1a79270c)
      b52cfe41
  9. 24 Jun, 2018 1 commit
    • Vladislav Zavialov's avatar
      Do not imply NoStarIsType by TypeOperators/TypeInType · abd66223
      Vladislav Zavialov authored
      Implementation of the "Embrace TypeInType" proposal was done according
      to the spec, which specified that TypeOperators must imply NoStarIsType.
      This implication was meant to prevent breakage and to be removed in 2
      releases.  However, compiling head.hackage has shown that this
      implication only magnified the breakage, so there is no reason to have
      it in the first place.
      
      To remain in compliance with the three-release policy, we add a
      workaround to define the (*) type operator even when -XStarIsType is on.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, RyanGlScott, goldfire, phadej, hvr
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4865
      abd66223
  10. 20 Jun, 2018 1 commit
  11. 18 Jun, 2018 1 commit
  12. 17 Jun, 2018 3 commits
    • Vladislav Zavialov's avatar
      Add -Werror=compat · 04e9fe5c
      Vladislav Zavialov authored
      Add a flag `-Werror=compat` to GHC which has the effect of `-Werror=x
      -Werror=y ...`, where `x, y, ...` are warnings from the `-Wcompat`
      option group.
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15278
      
      Differential Revision: https://phabricator.haskell.org/D4860
      04e9fe5c
    • Ryan Scott's avatar
      Provide a better error message for unpromotable data constructor contexts · c6375411
      Ryan Scott authored
      Trac #14845 brought to light a corner case where a data
      constructor could not be promoted (even with `-XTypeInType`) due to
      an unpromotable constraint in its context. However, the error message
      was less than helpful, so this patch adds an additional check to
      `tcTyVar` catch unpromotable data constructors like these //before//
      they're promoted, and to give a sensible error message in such cases.
      
      Test Plan: make test TEST="T13895 T14845"
      
      Reviewers: simonpj, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #13895, #14845
      
      Differential Revision: https://phabricator.haskell.org/D4728
      c6375411
    • Vladislav Zavialov's avatar
      Warn about implicit kind variables with -Wcompat · 8df24474
      Vladislav Zavialov authored
      According to an accepted proposal
      https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/002
      4-no-kind-vars.rst
      
          With -Wcompat, warn if a kind variable is brought into scope
          implicitly in a type with an explicit forall. This applies to type
          signatures and to other contexts that allow a forall with the
          forall-or-nothing rule in effect (for example, class instances).
      
      Test Plan: Validate
      
      Reviewers: goldfire, hvr, bgamari, RyanGlScott
      
      Reviewed By: goldfire
      
      Subscribers: RyanGlScott, rwbarton, thomie, carter
      
      GHC Trac Issues: #15264
      
      Differential Revision: https://phabricator.haskell.org/D4834
      8df24474
  13. 16 Jun, 2018 1 commit
    • Richard Eisenberg's avatar
      Quantify unfixed kind variables in CUSKs · 12794287
      Richard Eisenberg authored
      This is a small change in user-facing behavior. When we
      have a unification variable left over in a CUSK, we previously
      would issue an error. But, we can just quantify. This also
      teaches kcLHsQTyVars to use quantifyTyVars instead of its own,
      ad-hoc quantification scheme.
      
      Fixes #15273.
      
      test case: polykinds/T11648b
      12794287
  14. 15 Jun, 2018 2 commits
  15. 14 Jun, 2018 6 commits
    • Nathan Collins's avatar
      3a18a82f
    • Vladislav Zavialov's avatar
      Embrace -XTypeInType, add -XStarIsType · d650729f
      Vladislav Zavialov authored
      Summary:
      Implement the "Embrace Type :: Type" GHC proposal,
      .../ghc-proposals/blob/master/proposals/0020-no-type-in-type.rst
      
      GHC 8.0 included a major change to GHC's type system: the Type :: Type
      axiom. Though casual users were protected from this by hiding its
      features behind the -XTypeInType extension, all programs written in GHC
      8+ have the axiom behind the scenes. In order to preserve backward
      compatibility, various legacy features were left unchanged. For example,
      with -XDataKinds but not -XTypeInType, GADTs could not be used in types.
      Now these restrictions are lifted and -XTypeInType becomes a redundant
      flag that will be eventually deprecated.
      
      * Incorporate the features currently in -XTypeInType into the
        -XPolyKinds and -XDataKinds extensions.
      * Introduce a new extension -XStarIsType to control how to parse * in
        code and whether to print it in error messages.
      
      Test Plan: Validate
      
      Reviewers: goldfire, hvr, bgamari, alanz, simonpj
      
      Reviewed By: goldfire, simonpj
      
      Subscribers: rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #15195
      
      Differential Revision: https://phabricator.haskell.org/D4748
      d650729f
    • Ben Gamari's avatar
      4672e2eb
    • Tao He's avatar
      Replace `showSDocUnsafe` with `showSDoc` in extending_ghc.rst · d24e73ad
      Tao He authored
      ... and fix compile errors.
      
      Replace the usage of `showSDocUnsafe` with `showSDoc dflags`
      in example code in extending_ghc.rts.
      
      This example contains several compile errors (missing import
      and syntax error), this patch also fixes that.
      
      Test Plan: [skip ci]
      
      Reviewers: bgamari, mpickering
      
      Reviewed By: mpickering
      
      Subscribers: mpickering, rwbarton, thomie, carter
      
      GHC Trac Issues: #15228
      
      Differential Revision: https://phabricator.haskell.org/D4815
      d24e73ad
    • Takenobu Tani's avatar
      users-guide: Fix PtrRepLifted to LiftedRep · 87d691c0
      Takenobu Tani authored
      Fix `TYPE 'PtrRepLifted` to `TYPE 'LiftedRep`
      
      [ci skip]
      
      Test Plan: build
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4818
      87d691c0
    • Ömer Sinan Ağacan's avatar
      Update user manual sections for -rtsopts and -with-rtsopts · 97d14198
      Ömer Sinan Ağacan authored
      - References to -rtsopts updated for the new ignore and ignoreAll
        options.
      
      - Short description of -rtsopts updated. ignore and ignoreAll are now
        shown in the man page.
      
      - Add a few clarifications about -rtsopts and -with-rtsopts interaction.
      
      Reviewers: bgamari, AndreasK
      
      Reviewed By: AndreasK
      
      Subscribers: Phyx, rwbarton, thomie, carter
      
      GHC Trac Issues: #15268
      
      Differential Revision: https://phabricator.haskell.org/D4840
      97d14198
  16. 12 Jun, 2018 1 commit
  17. 10 Jun, 2018 1 commit
  18. 08 Jun, 2018 2 commits
  19. 07 Jun, 2018 2 commits
    • Matthew Pickering's avatar
      Run typeCheckResultAction and renamedResultAction in TcM rather than Hsc · dc8c03b2
      Matthew Pickering authored
      The primary motivation for this is that this allows users to access
      the warnings and error machinery present in TcM. However, it also allows
      users to use TcM actions which means they can typecheck GhcPs which
      could be significantly easier than constructing GhcTc.
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15229
      
      Differential Revision: https://phabricator.haskell.org/D4792
      dc8c03b2
    • Ryan Scott's avatar
      Document #15079 in the users' guide · bc9a838a
      Ryan Scott authored
      Trac #15079 revealed an interesting limitation in the interaction
      between variable visibility and higher-rank kinds. We (Richard and I)
      came to the conclusion that this is an acceptable (albeit surprising)
      limitation, so this documents in the users' guide to hopefully eliminate
      some confusion for others in the future.
      
      Test Plan: Read it
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15079
      
      Differential Revision: https://phabricator.haskell.org/D4803
      bc9a838a
  20. 05 Jun, 2018 1 commit
    • Ryan Scott's avatar
      Introduce DerivingVia · 8ed8b037
      Ryan Scott authored
      This implements the `DerivingVia` proposal put forth in
      https://github.com/ghc-proposals/ghc-proposals/pull/120.
      
      This introduces the `DerivingVia` deriving strategy. This is a
      generalization of `GeneralizedNewtypeDeriving` that permits the user
      to specify the type to `coerce` from.
      
      The major change in this patch is the introduction of the
      `ViaStrategy` constructor to `DerivStrategy`, which takes a type
      as a field. As a result, `DerivStrategy` is no longer a simple
      enumeration type, but rather something that must be renamed and
      typechecked. The process by which this is done is explained more
      thoroughly in section 3 of this paper
      ( https://www.kosmikus.org/DerivingVia/deriving-via-paper.pdf ),
      although I have inlined the relevant parts into Notes where possible.
      
      There are some knock-on changes as well. I took the opportunity to
      do some refactoring of code in `TcDeriv`, especially the
      `mkNewTypeEqn` function, since it was bundling all of the logic for
      (1) deriving instances for newtypes and
      (2) `GeneralizedNewtypeDeriving`
      into one huge broth. `DerivingVia` reuses much of part (2), so that
      was factored out as much as possible.
      
      Bumps the Haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, bgamari, goldfire, alanz
      
      Subscribers: alanz, goldfire, rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #15178
      
      Differential Revision: https://phabricator.haskell.org/D4684
      8ed8b037
  21. 04 Jun, 2018 3 commits
    • Simon Jakobi's avatar
      Serialize docstrings to ifaces, display them with new GHCi :doc command · 85309a3c
      Simon Jakobi authored
      If `-haddock` is set, we now extract docstrings from the renamed ast
      and serialize them in the .hi-files.
      
      This includes some of the changes from D4749 with the notable
      exceptions of the docstring lexing and renaming.
      
      A currently limited and experimental GHCi :doc command can be used
      to display docstrings for declarations.
      
      The formatting of pretty-printed docstrings is changed slightly,
      causing some changes in testsuite/tests/haddock.
      
      Test Plan: ./validate
      
      Reviewers: alexbiehl, hvr, gershomb, harpocrates, bgamari
      
      Reviewed By: alexbiehl
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4758
      85309a3c
    • Simon Peyton Jones's avatar
      Implement QuantifiedConstraints · 7df58960
      Simon Peyton Jones authored
      We have wanted quantified constraints for ages and, as I hoped,
      they proved remarkably simple to implement.   All the machinery was
      already in place.
      
      The main ticket is Trac #2893, but also relevant are
        #5927
        #8516
        #9123 (especially!  higher kinded roles)
        #14070
        #14317
      
      The wiki page is
        https://ghc.haskell.org/trac/ghc/wiki/QuantifiedConstraints
      which in turn contains a link to the GHC Proposal where the change
      is specified.
      
      Here is the relevant Note:
      
      Note [Quantified constraints]
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      The -XQuantifiedConstraints extension allows type-class contexts like
      this:
      
        data Rose f x = Rose x (f (Rose f x))
      
        instance (Eq a, forall b. Eq b => Eq (f b))
              => Eq (Rose f a)  where
          (Rose x1 rs1) == (Rose x2 rs2) = x1==x2 && rs1 >= rs2
      
      Note the (forall b. Eq b => Eq (f b)) in the instance contexts.
      This quantified constraint is needed to solve the
       [W] (Eq (f (Rose f x)))
      constraint which arises form the (==) definition.
      
      Here are the moving parts
        * Language extension {-# LANGUAGE QuantifiedConstraints #-}
          and add it to ghc-boot-th:GHC.LanguageExtensions.Type.Extension
      
        * A new form of evidence, EvDFun, that is used to discharge
          such wanted constraints
      
        * checkValidType gets some changes to accept forall-constraints
          only in the right places.
      
        * Type.PredTree gets a new constructor ForAllPred, and
          and classifyPredType analyses a PredType to decompose
          the new forall-constraints
      
        * Define a type TcRnTypes.QCInst, which holds a given
          quantified constraint in the inert set
      
        * TcSMonad.InertCans gets an extra field, inert_insts :: [QCInst],
          which holds all the Given forall-constraints.  In effect,
          such Given constraints are like local instance decls.
      
        * When trying to solve a class constraint, via
          TcInteract.matchInstEnv, use the InstEnv from inert_insts
          so that we include the local Given forall-constraints
          in the lookup.  (See TcSMonad.getInstEnvs.)
      
        * topReactionsStage calls doTopReactOther for CIrredCan and
          CTyEqCan, so they can try to react with any given
          quantified constraints (TcInteract.matchLocalInst)
      
        * TcCanonical.canForAll deals with solving a
          forall-constraint.  See
             Note [Solving a Wanted forall-constraint]
             Note [Solving a Wanted forall-constraint]
      
        * We augment the kick-out code to kick out an inert
          forall constraint if it can be rewritten by a new
          type equality; see TcSMonad.kick_out_rewritable
      
      Some other related refactoring
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      * Move SCC on evidence bindings to post-desugaring, which fixed
        #14735, and is generally nicer anyway because we can use
        existing CoreSyn free-var functions.  (Quantified constraints
        made the free-vars of an ev-term a bit more complicated.)
      
      * In LookupInstResult, replace GenInst with OneInst and NotSure,
        using the latter for multiple matches and/or one or more
        unifiers
      7df58960
    • Andreas Klebinger's avatar
      Document the fact that cmm dumps won't show unreachable blocks. · 36091ec9
      Andreas Klebinger authored
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4788
      36091ec9
  22. 03 Jun, 2018 1 commit