1. 23 Mar, 2015 1 commit
  2. 20 Mar, 2015 1 commit
  3. 02 Mar, 2015 1 commit
    • Simon Peyton Jones's avatar
      Two kind-polymorphism fixes (Trac #10122) · cabe1748
      Simon Peyton Jones authored
      * The original fix was to improve the documentation, in
        line with the suggestions on Trac #10122
      
      * But in doing so I realised that the kind generalisation in
        TcRnDriver.tcRnType was completely wrong.  So I fixed that
        and updated Note [Kind-generalise in tcRnType] to explain.
      cabe1748
  4. 19 Feb, 2015 1 commit
    • thomasw's avatar
      Fix #10045 · e9d72cef
      thomasw authored
      Summary:
      SPJ's solution is to only bring the `TcId` (which includes the type) of a
      binder into scope when it had a non-partial type signature.
      
      Take care of this by only storing the `TcId` in `TcSigInfo` of non-partial
      type signatures, hence the change to `sig_poly_id :: Maybe TcId`. Only in case
      of a `Just` will we bring the `TcId` in scope. We still need to know the name
      of the binder, even when it has a partial type signature, so add a `sig_name
      :: Name` field. The field `sig_partial :: Bool` is no longer necessary, so
      reimplement `isPartialSig` in terms of `sig_poly_id`.
      
      Note that the new test case fails, but not because of a panic, but because the
      `Num a` constraint is missing. Adding an extra-constraints wildcard to
      `copy`'s signature would fix it.
      
      Test Plan: validate
      
      Reviewers: simonpj, austin
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D646
      
      GHC Trac Issues: #10045
      e9d72cef
  5. 13 Jan, 2015 1 commit
  6. 06 Jan, 2015 3 commits
    • Simon Peyton Jones's avatar
      Major patch to add -fwarn-redundant-constraints · 32973bf3
      Simon Peyton Jones authored
      The idea was promted by Trac #9939, but it was Christmas, so I did
      some recreational programming that went much further.
      
      The idea is to warn when a constraint in a user-supplied context is
      redundant.  Everything is described in detail in
        Note [Tracking redundant constraints]
      in TcSimplify.
      
      Main changes:
      
       * The new ic_status field in an implication, of type ImplicStatus.
         It replaces ic_insol, and includes information about redundant
         constraints.
      
       * New function TcSimplify.setImplicationStatus sets the ic_status.
      
       * TcSigInfo has sig_report_redundant field to say whenther a
         redundant constraint should be reported; and similarly
         the FunSigCtxt constructor of UserTypeCtxt
      
       * EvBinds has a field eb_is_given, to record whether it is a given
         or wanted binding. Some consequential chagnes to creating an evidence
         binding (so that we record whether it is given or wanted).
      
       * AbsBinds field abs_ev_binds is now a *list* of TcEvBiinds;
         see Note [Typechecking plan for instance declarations] in
         TcInstDcls
      
       * Some significant changes to the type checking of instance
         declarations; Note [Typechecking plan for instance declarations]
         in TcInstDcls.
      
       * I found that TcErrors.relevantBindings was failing to zonk the
         origin of the constraint it was looking at, and hence failing to
         find some relevant bindings.  Easy to fix, and orthogonal to
         everything else, but hard to disentangle.
      
      Some minor refactorig:
      
       * TcMType.newSimpleWanteds moves to Inst, renamed as newWanteds
      
       * TcClassDcl and TcInstDcls now have their own code for typechecking
         a method body, rather than sharing a single function. The shared
         function (ws TcClassDcl.tcInstanceMethodBody) didn't have much code
         and the differences were growing confusing.
      
       * Add new function TcRnMonad.pushLevelAndCaptureConstraints, and
         use it
      
       * Add new function Bag.catBagMaybes, and use it in TcSimplify
      32973bf3
    • Simon Peyton Jones's avatar
      Print singleton consraints without parens · da9b2ec3
      Simon Peyton Jones authored
      The main change is in TypeRep.pprTheta, so we print
             Eq a
      for a singleton, but
            (Eq a, Show a)
      for multiple constraints.
      
      There are lots of trivial knock-on changes to error messages
      da9b2ec3
    • Simon Peyton Jones's avatar
      Modify a couple of error messages slightly · 00e1fc1b
      Simon Peyton Jones authored
      In particular
        In the type signature for:
           f :: Int -> Int
      I added the colon
      
      Also reword the "maybe you haven't applied a function to enough arguments?"
      suggestion to make grammatical sense.
      
      These tiny changes affect a lot of error messages.
      00e1fc1b
  7. 23 Dec, 2014 2 commits
    • thomasw's avatar
      Rename NamedWildcards flag to NamedWildCards · 089222c9
      thomasw authored
      Summary:
      Mind the capital C. As there is already a flag RecordWildCards with a capital
      C, we should at least try to be consistent in the spelling of WildCards.
      
      Test Plan: validate
      
      Reviewers: goldfire, simonpj, austin
      
      Reviewed By: simonpj, austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D584
      089222c9
    • thomasw's avatar
      Fix panic on :kind _ in GHCi (Trac #9879) · 6eb86a56
      thomasw authored
      Summary:
      Running `:kind _` in GHCi produced a panic, fix it by extracting the
      wildcards. Now, `:kind _` produces `_ :: k0`. Unfortunately, a `0` is
      added after the kind is tidied and I haven't found a way to get rid of
      it...
      
      This does not fix the other panic involving TemplateHaskell mentioned
      in #9879.
      
      Test Plan: new test GHCiWildcardKind should pass
      
      Reviewers: austin, simonpj
      
      Reviewed By: austin
      
      Subscribers: simonpj, carter, thomie, monoidal
      
      Differential Revision: https://phabricator.haskell.org/D572
      
      GHC Trac Issues: #9879
      6eb86a56
  8. 15 Dec, 2014 1 commit
    • thomasw's avatar
      Fix panic on [t| _ |] (Trac #9879) · 48222831
      thomasw authored
      Summary:
      Type brackets containing a wildcard, e.g. `[t| _ |]`, caused a panic.
      Fix it by disallowing wildcards in type brackets.
      
      Together with D572, this fixes #9879.
      
      Test Plan: new test WildcardInTypeBrackets should pass
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: carter, thomie, monoidal
      
      Differential Revision: https://phabricator.haskell.org/D573
      
      GHC Trac Issues: #9879
      48222831
  9. 28 Nov, 2014 1 commit