1. 01 Dec, 2015 2 commits
    • thomie's avatar
      Build system: Add stage specific SRC_HC_(WARNING_)OPTS · 14d0f7f1
      thomie authored
      * Add stage specific versions of SRC_HC_OPTS. These are currently only
        used for -Werror. The previous combination of GhcStage2HcOpts and
        GhcLibHcOpts didn't apply to utils/*.
      
      * Add stage specific versions of SRC_HC_WARNING_OPTS. These will later be
        used for new warning supression flags that should not be passed to the
        bootstrap compiler.
      
      * Move -Wall (and -Werror) related code back to mk/warnings.mk, where it
        was before 987d5427. Now all warning related code is nicely together.
        Include mk/warnings.mk after mk/custom-settings.mk to make this work.
      
      Reviewed By: bgamari, hvr
      
      Differential Revision: https://phabricator.haskell.org/D1536
      14d0f7f1
    • Ömer Sinan Ağacan's avatar
      MkId: Typos in comments · afb72139
      Ömer Sinan Ağacan authored
      afb72139
  2. 29 Nov, 2015 11 commits
    • quchen's avatar
      Implement warnings for Semigroups as parent of Monoid · 290def72
      quchen authored
      This patch is similar to the AMP patch (#8004), which offered two
      functions:
      
        1. Warn when an instance of a class has been given, but the type does
           not have a certain superclass instance
        2. Warn when top-level definitions conflict with future Prelude names
      
      These warnings are issued as part of the new `-Wcompat` warning group.
      
      Reviewers: hvr, ekmett, austin, bgamari
      
      Reviewed By: hvr, ekmett, bgamari
      
      Subscribers: ekmett, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1539
      
      GHC Trac Issues: #11139
      290def72
    • Ömer Sinan Ağacan's avatar
      Some improvements on CoreToDos passed to plugins · bcd55a94
      Ömer Sinan Ağacan authored
      This patch does two improvements:
      
      - We now show ToDos in `CoreDoPasses`. This is pretty important,
        otherwise `CoreDoPasses` makes debugging impossible in some cases.
      
      - Before running ToDos we run a cleanup pass on ToDos to remove
        `CoreDoNothing`s and flatten `CoreDoPasses`. This removes a lot of
        noise from `[CoreToDo]` argument passed to plugins.
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1548
      bcd55a94
    • Ben Gamari's avatar
      ghci: Refactor handling of :show · f101a822
      Ben Gamari authored
      In so doing ensure that the help text can't fall out of sync with the
      implementation.
      
      Test Plan: Validate and play in ghci
      
      Reviewers: austin, thomie
      
      Reviewed By: austin, thomie
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1538
      
      GHC Trac Issues: #11111
      f101a822
    • Herbert Valerio Riedel's avatar
      Remove redundant `#if`s · 58972131
      Herbert Valerio Riedel authored
      `#if __GLASGOW_HASKELL__ > xxx` macros make little sense inside `base`
      currently.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1541
      58972131
    • Herbert Valerio Riedel's avatar
      Update deepseq submodule · 616aceba
      Herbert Valerio Riedel authored
      This pulls in new NFData instances for NonEmpty and Semigroup newtype wrappers
      
      Differential Revision: https://phabricator.haskell.org/D1546
      616aceba
    • Herbert Valerio Riedel's avatar
      Update containers submodule · 54a94564
      Herbert Valerio Riedel authored
      Differential Revision: https://phabricator.haskell.org/D1545
      54a94564
    • thomie's avatar
      GHCi should not defer typed holes · 71c0cc15
      thomie authored
      In the function `tcUserStmt` in compiler/typecheck/TcRnDriver.hs, before
      going over the different ways ('plans') to lift an expression typed at
      the prompt into the GHCi monad, `Opt_DeferTypeErrors` is disabled. Here is
      the accompanying comment:
      
      ```
      -- Ensure that type errors don't get deferred when type checking the
      -- naked expression. Deferring type errors here is unhelpful because the
      -- expression gets evaluated right away anyway. It also would potentially
      -- emit redundant type-error warnings, one from each plan.
      ; plan <- unsetGOptM Opt_DeferTypeErrors $
      ```
      
      Since `Opt_DeferTypeErrors` implies `Opt_DeferTypedHoles`,
      `Opt_DeferTypedHoles` should be disabled here as well. This improves
      the error message for T10248 (it doesn't mention ghciStepIO anymore).
      This is a partial fix for #10249, and a complete fix for #11130.
      
      Depends on D1526
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: simonpj
      
      Differential Revision: https://phabricator.haskell.org/D1527
      
      GHC Trac Issues: #10249, #11130
      71c0cc15
    • Matthew Pickering's avatar
      Remove deprecated quasiquoter syntax. · 399a5b46
      Matthew Pickering authored
      In spirit, this reverts 9ba922ee
      
      The syntax has been deprecated with a warning since 2010.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1530
      399a5b46
    • Adam Sandberg Eriksson's avatar
      ghc-pkg: print version when verbose · 55c737fd
      Adam Sandberg Eriksson authored
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1534
      55c737fd
    • Ben Gamari's avatar
      ghci: Add support for prompt functions · 72e36207
      Ben Gamari authored
      This is an updated version of @jlengyel's original patch adding support
      for prompt functions.
      72e36207
    • Herbert Valerio Riedel's avatar
      Implement new -XTemplateHaskellQuotes pragma · 85fcd035
      Herbert Valerio Riedel authored
      Since f16ddcee / D876, `ghc-stage1`
      supports a subset of `-XTemplateHaskell`, but since we need Cabal to be
      able detect (so `.cabal` files can be specified accordingly, see also
      GHC #11102 which omits `TemplateHaskell` from `--supported-extensions`)
      whether GHC provides full or only partial `-XTemplateHaskell` support,
      the proper way to accomplish this is to split off the
      quotation/non-splicing `TemplateHaskell` feature-subset into a new
      language pragma `TemplateHaskellQuotes`.
      
      Moreover, `-XTemplateHaskellQuotes` is considered safe under SafeHaskell
      
      This addresses #11121
      
      Reviewers: goldfire, ezyang, dterei, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1511
      
      GHC Trac Issues: #11121
      85fcd035
  3. 28 Nov, 2015 1 commit
  4. 27 Nov, 2015 2 commits
  5. 26 Nov, 2015 3 commits
  6. 25 Nov, 2015 8 commits
    • Ben Gamari's avatar
      d2a2d5eb
    • Adam Gundry's avatar
      User documentation for DuplicateRecordFields · 5699ac94
      Adam Gundry authored
      This is a first draft of the user manual documentation for
      DuplicateRecordFields. Feedback welcome. I've intentionally made this a
      minimal change, but I wonder if it might make sense to pull out all the
      subsections on record system extensions ("Traditional record syntax",
      and "Record field disambiguation" through to "Record wildcards") into a
      new section? That is, is it worth breaking down the rather monolithic
      "Syntactic extensions" section?
      
      Test Plan: n/a
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1522
      5699ac94
    • Herbert Valerio Riedel's avatar
      User's Guide: Add links to MFP wiki page · c7a058fb
      Herbert Valerio Riedel authored
      Test Plan: IIAM
      
      Reviewers: austin, bgamari, quchen
      
      Reviewed By: bgamari, quchen
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1529
      
      GHC Trac Issues: #10751
      c7a058fb
    • Ben Gamari's avatar
      Note STM's vulnerability to non-allocating loops · 9aa94586
      Ben Gamari authored
      Test Plan: Read it
      
      Reviewers: austin, fryguybob
      
      Reviewed By: austin
      
      Subscribers: thomie, fryguybob
      
      Differential Revision: https://phabricator.haskell.org/D1523
      
      GHC Trac Issues: #10639, #367
      9aa94586
    • Simon Peyton Jones's avatar
      e9136762
    • Simon Peyton Jones's avatar
      Comments only · e9a4c099
      Simon Peyton Jones authored
      e9a4c099
    • Simon Peyton Jones's avatar
      Refactor default methods (Trac #11105) · 924f8517
      Simon Peyton Jones authored
      This patch does some signficant refactoring to the treatment
      of default methods in class declarations, and more generally
      to the type checking of type/class decls.
      
      Highlights:
      
      * When the class has a generic-default method, such as
           class C a where
             op :: a -> a -> Bool
             default op :: Ord a => a -> a -> a
        the ClassOpItem records the type of the generic-default,
        in this case the type (Ord a => a -> a -> a)
      
      * I killed off Class.DefMeth in favour of the very-similar
        BasicTypes.DefMethSpec.  However it turned out to be better
        to use a Maybe, thus
            Maybe (DefMethSpec Type)
        with Nothing meaning "no default method".
      
      * In TcTyClsDecls.tcTyClGroup, we used to accumulate a [TyThing],
        but I found a way to make it much simpler, accumulating only
        a [TyCon].  Much less wrapping and unwrapping.
      
      * On the way I also fixed Trac #10896 in a better way. Instead
        of killing off all ambiguity checks whenever there are any type
        errors (the fix in commit 8e8b9ed9), I instead recover in
        TcTyClsDecls.checkValidTyCl.
      
      There was a lot of associated simplification all round
      924f8517
    • Herbert Valerio Riedel's avatar
      update link to MonadFail proposal · 9032d056
      Herbert Valerio Riedel authored
      [skip ci]
      9032d056
  7. 24 Nov, 2015 9 commits
    • Ben Gamari's avatar
      DynFlags: Drop stale comment · 76f3142d
      Ben Gamari authored
      76f3142d
    • Simon Peyton Jones's avatar
      Simplify the MonadFail code · 5e04c384
      Simon Peyton Jones authored
      Simplify and tidy up the MonadFail code.
      See TcMatches.tcMonadFailOp
      
      Less, code; and more robust.
      
      This incidentally fixes a bug; see the change
      to MonadFailErrors.stderr
      5e04c384
    • Simon Peyton Jones's avatar
      Comments only · 8dc6da83
      Simon Peyton Jones authored
      8dc6da83
    • Ben Gamari's avatar
      8c5fe53b
    • Ben Gamari's avatar
      Rewrite checkUniques and incorporate into validate · e506f02d
      Ben Gamari authored
      This should catch duplicate uniques in the future before Bad Things
      happen.
      
      Test Plan: Introduce a duplicate unique and validate
      
      Reviewers: austin, hvr, thomie
      
      Reviewed By: hvr, thomie
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1521
      e506f02d
    • quchen's avatar
      Add -Wcompat warning flag group · 6d147939
      quchen authored
      Reviewers: hvr, austin, thomie, bgamari
      
      Reviewed By: hvr, austin, thomie, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1495
      
      GHC Trac Issues: #11000
      6d147939
    • elaforge's avatar
      Rearrange error msgs and add section markers (Trac #11014). · c05fddde
      elaforge authored
      This puts the "Relevant bindings" section at the end.
      
      It uses a TcErrors.Report Monoid to divide messages by importance and
      then mappends them together.  This is not the most efficient way since
      there are various intermediate Reports and list appends, but it probably
      doesn't matter since error messages shouldn't get that large, and are
      usually prepended.  In practice, everything is `important` except
      `relevantBindings`, which is `supplementary`.
      
      ErrMsg's errMsgShortDoc and errMsgExtraInfo were extracted into ErrDoc,
      which has important, context, and suppelementary fields.  Each of those
      three sections is marked with a bullet character, '•' on unicode
      terminals and '*' on ascii terminals.  Since this breaks tons of tests,
      I also modified testlib.normalise_errmsg to strip out '•'s.
      
      --- Additional notes:
      
      To avoid prepending * to an empty doc, I needed to filter empty docs.
      This seemed less error-prone than trying to modify everyone who produces
      SDoc to instead produce Maybe SDoc.  So I added `Outputable.isEmpty`.
      Unfortunately it needs a DynFlags, which is kind of bogus, but otherwise
      I think I'd need another Empty case for SDoc, and then it couldn't be a
      newtype any more.
      
      ErrMsg's errMsgShortString is only used by the Show instance, which is
      in turn only used by Show HscTypes.SourceError, which is in turn only
      needed for the Exception instance.  So it's probably possible to get rid
      of errMsgShortString, but that would a be an unrelated cleanup.
      
      Fixes #11014.
      
      Test Plan: see above
      
      Reviewers: austin, simonpj, thomie, bgamari
      
      Reviewed By: thomie, bgamari
      
      Subscribers: simonpj, nomeata, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1427
      
      GHC Trac Issues: #11014
      c05fddde
    • Herbert Valerio Riedel's avatar
      Implement new `-fwarn-noncanonical-monad-instances` · f09f2470
      Herbert Valerio Riedel authored
      Warn about incoherent/non-canonical 'Applicative'/'Monad' instance
      declarations. Specifically the following invariants are checked:
      
      In 'Monad' instances declarations warn if the any of the following
      conditions does not hold:
      
       * If `return` is overridden it must be canonical (i.e. `return = pure`).
       * If `(>>)` is overridden it must be canonical (i.e. `(>>) = (*>)`).
      
      In 'Applicative' instance declarations:
      
       * Warn if 'pure' is defined backwards (i.e. `pure = return`).
       * Warn if '(*>)' is defined backwards (i.e. `(*>) = (>>)`).
      
      NB, this warning flag is not enabled via `-Wall` nor `-Wcompat`.
      
      This addresses #11128
      
      Reviewers: quchen, austin, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1516
      f09f2470
    • Herbert Valerio Riedel's avatar
      Add `PrelNames.thenAName` for `Applicative(*>)` · 12dbc892
      Herbert Valerio Riedel authored
      This is needed to allow subsequent patches to refer to `*>`.
      
      While at it, this commit also groups together the `Applicative` definitions
      to reduce confusion.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1513
      12dbc892
  8. 23 Nov, 2015 4 commits