1. 25 Nov, 2015 6 commits
  2. 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
  3. 23 Nov, 2015 16 commits
  4. 22 Nov, 2015 6 commits
    • niteria's avatar
      Make abstractVars deterministic in SetLevel · 6393dd8e
      niteria authored
      This fixes a non-determinism bug where depending on the order
      of uniques allocated, the type variables would be in a different order
      when abstracted for the purpose of lifting out an expression.
      
      Test Plan:
      I've added a new testcase that reproduces the problem
      ./validate
      
      Reviewers: simonmar, austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: nomeata, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1504
      
      GHC Trac Issues: #4012
      6393dd8e
    • Alan Zimmerman's avatar
      ApiAnnotations: Make all RdrName occurences Located · 3df9563e
      Alan Zimmerman authored
      At the moment the API Annotations can only be used on the ParsedSource,
      as there are changes made to the RenamedSource that prevent it from
      being used to round trip source code.
      
      It is possible to build a map from every Located Name in the
      RenamedSource from its location to the Name, which can then be used when
      resolved names are required when changing the ParsedSource.
      
      However, there are instances where the identifier is not located,
      specifically
      
        (GHC.VarPat name)
        (GHC.HsVar name)
        (GHC.UserTyVar name)
        (GHC.HsTyVar name)
      
      Replace each of the name types above with (Located name)
      
      Updates the haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: goldfire, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1512
      
      GHC Trac Issues: #11019
      3df9563e
    • Erik de Castro Lopo's avatar
      New expected test output for 32 bit platforms · 64737f2d
      Erik de Castro Lopo authored
      Test Plan: Test on Arm and PowerPc.
      
      Reviewers: bgamari, thomie, austin
      
      Differential Revision: https://phabricator.haskell.org/D1510
      
      GHC Trac Issues: #11060
      64737f2d
    • Alan Zimmerman's avatar
      Add comment to Parser.y re extra API Annotation · 638fde50
      Alan Zimmerman authored
      Document extra AnnRarrow annotation on a HsFunTy
      638fde50
    • Herbert Valerio Riedel's avatar
      Follow-up fix to 3e2a4eef (re #11109) · 4976ab2b
      Herbert Valerio Riedel authored
      Using `:` as sed-`s`-expr separator is not a good idea on windows, as
      this can result in an expression like
      
         's:@INSTALL@:$(subst ../install-sh,E:/msys64/home/foo/ghc/install-sh,@INSTALL@):g'
      
      (note the `E:/` drive component)
      
      Using `|` instead of `:` has less risk of collision with the substitution expression
      4976ab2b
    • Herbert Valerio Riedel's avatar
      Remove accidentally added T10359 blob · a703fbce
      Herbert Valerio Riedel authored
      This sneaked in via 2325bd4e / D1468 / #4012
      
      This is frustrating... we've added a useless 2.4MiB binary blob to our
      Git history which wastes *everyones* bandwidth for eternity
      (unless we truncate or rewrite history).
      
      We should add lint-checks and/or a pre-receive commit hook test to prevent
      this in future.
      a703fbce
  5. 21 Nov, 2015 3 commits
    • roshats's avatar
      Function definition in GHCi · b98ff3cc
      roshats authored
      This patch allows define and re-define functions in ghci. `let` is not
      required anymore (but can be used).
      
      Idea: If ghci input string can be parsed as statement then run it as
      statement else run it as declaration.
      
      Reviewers: mpickering, bgamari, austin
      
      Reviewed By: mpickering, bgamari, austin
      
      Subscribers: hvr, mpickering, dterei, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1299
      
      GHC Trac Issues: #7253
      b98ff3cc
    • niteria's avatar
      Create a deterministic version of tyVarsOfType · 2325bd4e
      niteria authored
      I've run into situations where I need deterministic `tyVarsOfType` and
      this implementation achieves that and also brings an algorithmic
      improvement.  Union of two `VarSet`s takes linear time the size of the
      sets and in the worst case we can have `n` unions of sets of sizes
      `(n-1, 1), (n-2, 1)...` making it quadratic.
      
      One reason why we need deterministic `tyVarsOfType` is in `abstractVars`
      in `SetLevels`. When we abstract type variables when floating we want
      them to be abstracted in deterministic order.
      
      Test Plan: harbormaster
      
      Reviewers: simonpj, goldfire, austin, hvr, simonmar, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1468
      
      GHC Trac Issues: #4012
      2325bd4e
    • niteria's avatar
      Add DVarSet - a deterministic set of Vars · 6664ab83
      niteria authored
      This implements `DVarSet`, a deterministic set of Vars, with an
      interface very similar to `VarSet` with a couple of functions missing.
      
      I will need this in changes that follow, one of them will be about
      changing the type of the set of Vars that `RuleInfo` holds to make the
      free variable computation deterministic.
      
      Test Plan:
      ./validate
      I can add new tests if anyone wants me to.
      
      Reviewers: simonpj, simonmar, austin, bgamari
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1487
      
      GHC Trac Issues: #4012
      6664ab83