1. 07 Jan, 2014 8 commits
  2. 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.
      4d70840d
    • 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
      9e10d188
    • 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
      5dffb4ac
    • 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.
      e60a841b
    • Simon Peyton Jones's avatar
      Add alterOccEnv · 5c4265f2
      Simon Peyton Jones authored
      5c4265f2
    • 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.
      4853be24
  3. 02 Jan, 2014 3 commits
  4. 31 Dec, 2013 1 commit
  5. 30 Dec, 2013 1 commit
  6. 28 Dec, 2013 3 commits
    • Simon Peyton Jones's avatar
      Comments only · d58a8df3
      Simon Peyton Jones authored
      d58a8df3
    • 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!
      8721743e
    • 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
      follow-up.
      a6f6169a
  7. 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
      runQuasiQuoteHook.
      df2dd64d
    • 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.
      e4afeedc
  8. 18 Dec, 2013 1 commit
  9. 17 Dec, 2013 3 commits
  10. 16 Dec, 2013 10 commits
  11. 12 Dec, 2013 2 commits
    • Joachim Breitner's avatar
      Move peelFV from DmdAnal to Demand · 6b6a30d6
      Joachim Breitner authored
      6b6a30d6
    • Simon Peyton Jones's avatar
      Improve the handling of used-once stuff · 80989de9
      Simon Peyton Jones authored
      Joachim and I are committing this onto a branch so that we can share it,
      but we expect to do a bit more work before merging it onto head.
      
      Nofib staus:
        - Most programs, no change
        - A few improve
        - A couple get worse (cacheprof, tak, rfib)
      Investigating the "get worse" set is what's holding up putting this
      on head.
      
      The major issue is this.  Consider
      
          map (f g) ys
      
      where f's demand signature looks like
      
         f :: <L,C1(C1(U))> -> <L,U> -> .
      
      So 'f' is not saturated.  What demand do we place on g?
      Answer
              C(C1(U))
      That is, the inner C1 should stay, even though f is not saturated.
      
      I found that this made a significant difference in the demand signatures
      inferred in GHC.IO, which uses lots of higher-order exception handlers.
      
      I also had to add used-once demand signatures for some of the
      'catch' primops, so that we know their handlers are only called once.
      80989de9