1. 27 Feb, 2016 1 commit
  2. 26 Feb, 2016 9 commits
  3. 25 Feb, 2016 12 commits
    • barrucadu's avatar
      Print which warning-flag controls an emitted warning · bb5afd3c
      barrucadu authored
      Both gcc and clang tell which warning flag a reported warning can be
      controlled with, this patch makes ghc do the same. More generally, this
      allows for annotated compiler output, where an optional annotation is
      displayed in brackets after the severity.
      
      This also adds a new flag `-f(no-)show-warning-groups` to control
      whether to show which warning-group (such as `-Wall` or `-Wcompat`)
      a warning belongs to. This flag is on by default.
      
      This implements #10752
      
      Reviewed By: quchen, bgamari, hvr
      
      Differential Revision: https://phabricator.haskell.org/D1943
      bb5afd3c
    • Rik Steenkamp's avatar
      Improve pattern synonym error messages (add `PatSynOrigin`) · 116528c8
      Rik Steenkamp authored
      Adds a new data constructor `PatSynOrigin Bool Name` to the `CtOrigin`
      data type. This allows for better error messages when the origin of a
      wanted constraint is a pattern synonym declaration.
      
      Fixes T10873.
      
      Reviewers: mpickering, simonpj, austin, thomie, bgamari
      
      Reviewed By: simonpj, thomie, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1866
      
      GHC Trac Issues: #10873
      116528c8
    • Matthew Pickering's avatar
      Improve accuracy of suggestion to use TypeApplications · e38c07bf
      Matthew Pickering authored
      The suggestion only makes sense when we try
      to use an as pattern in an expression context.
      
      It is misleading in the case of a lazy pattern and
      view pattern.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1948
      e38c07bf
    • thomie's avatar
      Handle multiline named haddock comments properly · 6350eb11
      thomie authored
      Fixes #10398 in a different way, thereby also fixing #11579.
      
      I inverted the logic of the Bool argument to "worker", to hopefully make
      it more self-explanatory.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1935
      6350eb11
    • Georgios Karachalias's avatar
      (Alternative way to) address #8710 · 67393977
      Georgios Karachalias authored
      Issue a separate warning per redundant (or inaccessible) clause.
      This way each warning can have more precice location information
      (the location of the clause under consideration and not the whole
      match).
      
      I thought that this could be too much but actually the number of
      such warnings is bound by the number of cases matched against (in
      contrast to the non-exhaustive warnings which may be exponentially
      more).
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1920
      
      GHC Trac Issues: #8710
      67393977
    • Ben Gamari's avatar
      cmpTypeX: Avoid kind comparison when possible · 073e20eb
      Ben Gamari authored
      This comparison is only necessary when the types being compared contain
      casts. Otherwise the structural equality of the types implies that their
      kinds are equal.
      
      Test Plan: Validate
      
      Reviewers: goldfire, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1944
      
      GHC Trac Issues: #11597
      073e20eb
    • Matthew Pickering's avatar
      Reconstruct record expression in bidir pattern synonym · 52879d1f
      Matthew Pickering authored
      Reviewers: austin, rdragon, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rdragon, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1949
      52879d1f
    • manav's avatar
      Make warning names more consistent · 66584914
      manav authored
      - Replace "Sigs" with "Signatures" in WarningFlag data constructors.
      - Replace "PatSyn" with "PatternSynonym" in WarningFlag data
        constructors.
      - Deprecate "missing-local-sigs" in favor of "missing-local-signatures".
      - Deprecate "missing-exported-sigs" in favor of
        "missing-exported-signatures".
      - Deprecate "missing-pat-syn-signatures" in favor of
        "missing-pattern-synonym-signatures".
      - Replace "ddump-strsigs" with "ddump-str-signatures"
      
      These complete the tasks that were explicitly mentioned in #11583
      
      Test Plan:
      Executed `ghc --show-options` and verified that the flags were changed
      as expected.
      
      Reviewers: svenpanne, austin, bgamari
      
      Reviewed By: austin, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1939
      
      GHC Trac Issues: #11583
      66584914
    • Ömer Sinan Ağacan's avatar
      HscMain: Delete some unused code · 6319a8cf
      Ömer Sinan Ağacan authored
      Reviewers: bgamari, austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1936
      6319a8cf
    • Ben Gamari's avatar
      ApplicativeDo: Handle terminal `pure` statements · 0c7db61f
      Ben Gamari authored
      ApplicativeDo handled terminal `return` statements properly, but not
      `pure`.
      
      Test Plan: Validate with included testcase
      
      Reviewers: austin, simonmar
      
      Reviewed By: austin, simonmar
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1931
      
      GHC Trac Issues: #11607
      0c7db61f
    • Facundo Domínguez's avatar
      Overload the static form to reduce verbosity. · c1efdcc4
      Facundo Domínguez authored
      Static pointers are rarely used naked: most often they are defined at
      the base of a Closure, as defined in e.g. the distributed-closure and
      distributed-static packages. So a typical usage pattern is:
      
          distributeMap (closure (static (\x -> x * 2)))
      
      which is more verbose than it needs to be. Ideally we'd just have to
      write
      
          distributeMap (static (\x -> x * 2))
      
      and let the static pointer be lifted to a Closure implicitly. i.e.
      what we want is to overload static literals, just like we already
      overload list literals and string literals.
      
      This is achieved by introducing the IsStatic type class and changing
      the typing rule for static forms slightly:
      
          static (e :: t) :: IsStatic p => p t
      
      Test Plan: ./validate
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, mboes, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1923
      
      GHC Trac Issues: #11585
      c1efdcc4
    • Ben Gamari's avatar
      TyCoRep: Add haddock sections · 009a9997
      Ben Gamari authored
      009a9997
  4. 24 Feb, 2016 2 commits
    • Ömer Sinan Ağacan's avatar
      Remove "use mask" from StgAlt syntax · a9dc62ae
      Ömer Sinan Ağacan authored
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1933
      a9dc62ae
    • eir@cis.upenn.edu's avatar
      Address #11471 by putting RuntimeRep in kinds. · d8c64e86
      eir@cis.upenn.edu authored
      See Note [TYPE] in TysPrim. There are still some outstanding
      pieces in #11471 though, so this doesn't actually nail the bug.
      
      This commit also contains a few performance improvements:
      
      * Short-cut equality checking of nullary type syns
      
      * Compare types before kinds in eqType
      
      * INLINE coreViewOneStarKind
      
      * Store tycon binders separately from kinds.
      
      This resulted in a ~10% performance improvement in compiling
      the Cabal package. No change in functionality other than
      performance. (This affects the interface file format, though.)
      
      This commit updates the haddock submodule.
      d8c64e86
  5. 23 Feb, 2016 3 commits
  6. 20 Feb, 2016 2 commits
  7. 19 Feb, 2016 3 commits
    • thomie's avatar
      Modifier letter in middle of identifier is ok · d738e664
      thomie authored
      Refactoring only. Cleanup some loose ends from #10196.
      
      Initially the idea was to only allow modifier letters at the end of
      identifiers. Since we later decided to allow modifier letters also in
      the middle of identifiers (because not doing so would not fix the
      regression completely), the names `suffix` and `okIdSuffixChar` don't
      seem appropriate anymore.
      
      Remove TODO. Move test from should_fail to should_compile.
      d738e664
    • thomie's avatar
      Delete support for deprecated "-- # ..."-style haddock options · 2f733b3a
      thomie authored
      A long time ago, you could use `"-- # <haddock options>"` to mean that
      `<haddock options.` should be passed to `haddock`. Since 2007
      (03d8585e), using `OPTIONS_HADDOCK` is
      the preferred way to do this.
      
      Why is ok to remove support for "-- # .."?
      
      * It is not mentioned in the Haddock user's guide, nor are there any
        tests that use it.
      
      * Ever since 2011 (b3e30449), it doesn't
        actually work anymore. The function `getOptionsFromFile` uses
        `gopt_unset dflags Opt_Haddock` for other reasons, so even when
        running ghc with `--haddock`, the following rule always fires when the
        lexer sees "-- # ..", and it gets treated as a normal comment:
      
      ```
          -- Next, match Haddock comments if no -haddock flag
          "-- " [$docsym \#] .* / { ifExtension (not . haddockEnabled) } { lineCommentToken }
      ```
      
      Reviewed by: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1932
      2f733b3a
    • Gabor Greif's avatar
      A few more typos in non-code · 8b073f6c
      Gabor Greif authored
      8b073f6c
  8. 18 Feb, 2016 6 commits
    • Ben Gamari's avatar
      Unwire Typeable representation types · 206a8bf4
      Ben Gamari authored
      In order to make this work I needed to shuffle around typechecking a bit
      such that `TyCon` and friends are available during compilation of
      GHC.Types.  I also did a bit of refactoring of `TcTypeable`.
      
      Test Plan: Validate
      
      Reviewers: simonpj, austin
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1906
      
      GHC Trac Issues: #11120
      206a8bf4
    • Simon Peyton Jones's avatar
      Take type-function arity into account · a008eadf
      Simon Peyton Jones authored
      ...when computing the size of a call on the RHS of a type
      instance declaration.
      
      This came up in Trac #11581.  The change is in
         TcType.tcTyFamInsts
      which now trims the type arguments in a call.  See the
      comments with that function definition.
      a008eadf
    • Simon Peyton Jones's avatar
      Improve piResultTys and friends · 4d031cf9
      Simon Peyton Jones authored
      Several things here:
      
      * Re-implement piResultTys so that its substitution has
        the correct in-scope set
      
        That means paying close attention to performance, since as we
        discovered in Trac #11371, it's a heavily used function and
        is often used on ordinary function types, with no foralls to
        worry about substituting.
      
      * Kill off applyTys, which was just the same as piResultTys.
      
      * Re-engineer MkCore.mkCoreApps so that it calls piResultTys,
        rather than repeatedly calling piResultTy.
      4d031cf9
    • Simon Peyton Jones's avatar
      (Another) minor refactoring of substitutions · b5292557
      Simon Peyton Jones authored
      No change in functionality here, but greater clarity:
      
      * In FamInstEnv.FlattenEnv, kill off the fi_in_scope field
        We are already maintaining an in-scope set in the fe_subst field,
        so it's silly do to it twice.
      
        (This isn't strictly connected to the rest of this patch, but
        the nomenclature changes below affect the same code, so I put
        them together.)
      
      * TyCoRep.extendTCVSubst used to take a TyVar or a CoVar and work
        out what to do, but in fact we almost always know which of the
        two we are doing.  So:
          - define extendTvSubst, extendCvSubst
          - and use them
      
      * Similar renamings in TyCoRep:
         - extendTCvSubstList        -->   extendTvSubstList
         - extendTCvSubstBinder      -->   extendTvSubstBinder
         - extendTCvSubstAndInScope  --> extendTvSubstAndInScope
      
      * Add Type.extendTvSubstWithClone, extendCvSubstWithClone
      
      * Similar nomenclature changes in Subst, SimplEnv, Specialise
      
      * Kill off TyCoRep.substTelescope (never used)
      b5292557
    • Simon Peyton Jones's avatar
      Fix desugaring of bang-pattern let-bindings · 01449eb5
      Simon Peyton Jones authored
      When implementing Strict Haskell, the patch 46a03fbe didn't faithfully
      implement the semantics given in the manual. In particular there was
      an ad-hoc case in mkSelectorBinds for "strict and no binders" that
      didn't work.
      
      This patch fixes it, curing Trac #11572.
      
      Howver it forced me to think about banged let-bindings, and I rather
      think we do not have quite the right semantics yet, so I've opened
      Trac #11601.
      01449eb5
    • Ben Gamari's avatar
      Fix thinko that crept into D1908 · 27842ec1
      Ben Gamari authored
      RyanGlScott updated the Diff only after I had merged it.
      27842ec1
  9. 17 Feb, 2016 2 commits
    • eir@cis.upenn.edu's avatar
      Comments only (#11513) · 0c420cb6
      eir@cis.upenn.edu authored
      0c420cb6
    • Ryan Scott's avatar
      Remove superfluous code when deriving Foldable/Traversable · a82956df
      Ryan Scott authored
      Currently, `-XDeriveFoldable` and `-XDeriveTraversable` generate
      unnecessary `mempty` and `pure` expressions when it traverses of an
      argument of a constructor whose type does not mention the last type
      parameter. Not only is this inefficient, but it prevents `Traversable`
      from being derivable for datatypes with unlifted arguments (see
      Trac #11174).
      
      The solution to this problem is to adopt a slight change to the
      algorithms for `-XDeriveFoldable` and `-XDeriveTraversable`, which is
      described in [this wiki
      page](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DeriveFu
      nctor#Proposal:alternativestrategyforderivingFoldableandTraversable).
      The wiki page also describes why we don't apply the same changes to the
      algorithm for `-XDeriveFunctor`.
      
      This is techincally a breaking change for users of `-XDeriveFoldable`
      and `-XDeriveTraversable`, since if someone was using a law-breaking
      `Monoid` instance with a derived `Foldable` instance (i.e., one where `x
      <> mempty` does not equal `x`) or a law-breaking `Applicative` instance
      with a derived `Traversable` instance, then the new generated code could
      result in different behavior. I suspect the number of scenarios like
      this is very small, and the onus really should be on those users to fix
      up their `Monoid`/`Applicative` instances.
      
      Fixes #11174.
      
      Test Plan: ./validate
      
      Reviewers: hvr, simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1908
      
      GHC Trac Issues: #11174
      a82956df