1. 09 Jan, 2014 6 commits
  2. 08 Jan, 2014 1 commit
  3. 07 Jan, 2014 12 commits
  4. 03 Jan, 2014 6 commits
    • Benno Fünfstück's avatar
      Fix #5209: Reset GHCi prompt in multiline mode · 4d70840d
      Benno Fünfstück authored
      GHCi didn't reset the multiline prompt when an exception (in particular,
      the UserInterrupt exception) occured. This commit uses `finally` to
      reset the prompt in all cases.
    • Simon Peyton Jones's avatar
      Improve the equality-floating story (again), to fix Trac #8644 · 9e10d188
      Simon Peyton Jones authored
      We float equalities out of implications whose 'givens' include equalities.
      But it's a bit tricky knowing whether some givens do or do not include
      equalities, as #8644 shows.  There the given has type 'c' (which might
      have equalities), but we discover that 'c ~ ()', which definitely doesn't.
      In short, we must look at the givens *after* normalisation, not before.
      Moreover, something similar happens in approximateWC, where we need
      to ask whether an implication has given equalities.
      This patch does the job:
      * Add a Boolean field inert_no_eqs to InertCans, which records
        whether we've added a non-constant equality
      * Add a field ic_no_eqs to Implication, which records whether the
        ic_given binders include any equalities
      * Get rid of Inst.hasEqualities altogether
      On the way I did some un-forced refactoring
      * Introduce the auxiliary function TcCanonical.flattenNestedFamApp
      * Kill off FamHeadMap and PredMap in favour of
        the new FunEqMap and DictMap respectively
    • Simon Peyton Jones's avatar
      Refactor the way shadowing in handled in GHCi · 5dffb4ac
      Simon Peyton Jones authored
      If you say
        ghci> import Foo( T )
        ghci> data T = MkT
        ghci> data T = XXX
      then the second 'data T' should shadow the first.  But the qualified
      Foo.T should still be available.  We really weren't handling this
      correctly at all, resulting in Trac #8639 and #8628 among others
      This patch:
      * Add RdrName.extendGlobalRdrEnv, which does shadowing properly
      * Change HscTypes.icExtendGblRdrEnv (was badly-named icPlusGblRdrEnv)
        to use the new function
      * Change RnNames.extendGobalRdrEnvRn to use the new function
      * Move gresFrom Avails into RdrName
      * Better pprGlobalRdrEnv function in RdrName
    • Simon Peyton Jones's avatar
      Improve error message when using qualified names in GHCi · e60a841b
      Simon Peyton Jones authored
      When you say
        ghci> :i Foo.x
      GHCi tries to find module Foo and get 'x' from it.  But
      if Foo doesn't exist we don't want to say:
        Attempting to use module ‛Foo’ which is not loaded
      This is a bit confusing. Rather we just want to say that
      Foo.x is not in scope.
    • Simon Peyton Jones's avatar
      Add alterOccEnv · 5c4265f2
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Use the GlobalRdrEnv when renaming the axuiliary bindings in 'deriving' · 4853be24
      Simon Peyton Jones authored
      I'm not sure why were were using bindLocalNames before, but it triggers
      an assert failure that checks that local names are Internal.  This
      change makes things more uniform and straightforward.
  5. 02 Jan, 2014 3 commits
  6. 31 Dec, 2013 1 commit
  7. 30 Dec, 2013 1 commit
  8. 28 Dec, 2013 3 commits
    • Simon Peyton Jones's avatar
      Comments only · d58a8df3
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Re-factor TcCanonical (again), fixes Trac #8603 · 8721743e
      Simon Peyton Jones authored
      This is a substantial refactoring of the canonicaliser. The proximate
      cause was that we were sometimes failing to correctly orient a
      tyvar/tyvar equality (x ~ y), because the kind of x or y was not fully
      zonked at the moment we compared them.  That in turn led me to look
      closely at the way that canEvNC (which decomposes equalities) worked.
      * The big change is that the 'reOrient' and 'classify' functions are gone,
        along with classify's 'TypeClassifier' return type.  Instead the
        re-orientation is built into canEqNC.  When we find a type variable
        we divert into canEqTyVar, and so on, very much as in TcUnify.
      * TcCanonical.canEqTyVar, canEqLeafFun, etc now carry a SwapFlag (to
        reduce duplication), just as in TcUnify; now SwapFlag itself is
        defined in BasicTypes
      * I renamed TcSMonad.rewriteCtFlavor to rewriteEvidence,
      * I added a new specialised version of rewriteEvidence, called
        TcSMonad.rewriteEqEvidence.  It is easier to use, and removes
        the crafty but brain-mangling higher order casts that we were
        using before.
      The result is not exactly simpler, but it's pretty clear and, I think,
      significantly more efficient.  And it fixes Trac #8603!
    • Simon Peyton Jones's avatar
      Define mkTcNomReflCo = TcRefl Nominal, and use it all over · a6f6169a
      Simon Peyton Jones authored
      This patch doesn't include the changes to TcCanonical and TcSMonad,
      which are a bigger follow-up patch, so it is tightly coupled to the
  9. 27 Dec, 2013 2 commits
    • Edsko de Vries's avatar
      Add hook for splicing in renamer · df2dd64d
      Edsko de Vries authored
      With the recent modifications to the TH infrastructure, many splices are now
      expanded in the renamer rather than the typechecker. This means that tools
      which inspect the renamed tree don't get to see the original splices. Added a
      new hook which gets called before such a splice gets expanded, analogous to the
    • eir@cis.upenn.edu's avatar
      Fix #8607. · e4afeedc
      eir@cis.upenn.edu authored
      The solution (after many false starts) is to change the behavior of
      hsLTyClDeclBinders. The idea is that the locations of the names that
      the parser generates should really be the names' locations, unlike
      what was done in 17457791... But, when the renamer is creating Names
      from the RdrNames, the locations stored in the Names should be the
      declarations' locations. This is now achieved in hsLTyClDeclBinders,
      which returns [Located name], but the location is that of the
      *declaration*, not the name itself.
  10. 18 Dec, 2013 1 commit
  11. 17 Dec, 2013 3 commits
  12. 16 Dec, 2013 1 commit