1. 10 Jan, 2014 4 commits
  2. 09 Jan, 2014 8 commits
    • Simon Peyton Jones's avatar
      Comments only · 15a3de12
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Re-work the naming story for the GHCi prompt (Trac #8649) · 73c08ab1
      Simon Peyton Jones authored
      The basic idea here is simple, and described in Note [The interactive package]
      in HscTypes, which starts thus:
          Note [The interactive package]
          Type and class declarations at the command prompt are treated as if
          they were defined in modules
          with each bunch of declarations using a new module, all sharing a
          common package 'interactive' (see Module.interactivePackageId, and
          This scheme deals well with shadowing.  For example:
             ghci> data T = A
             ghci> data T = B
             ghci> :i A
             data Ghci1.T = A  -- Defined at <interactive>:2:10
          Here we must display info about constructor A, but its type T has been
          shadowed by the second declaration.  But it has a respectable
          qualified name (Ghci1.T), and its source location says where it was
          So the main invariant continues to hold, that in any session an original
          name M.T only refers to oe unique thing.  (In a previous iteration both
          the T's above were called :Interactive.T, albeit with different uniques,
          which gave rise to all sorts of trouble.)
      This scheme deals nicely with the original problem.  It allows us to
      eliminate a couple of grotseque hacks
        - Note [Outputable Orig RdrName] in HscTypes
        - Note [interactive name cache] in IfaceEnv
      (both these comments have gone, because the hacks they describe are no
      longer necessary). I was also able to simplify Outputable.QueryQualifyName,
      so that it takes a Module/OccName as args rather than a Name.
      However, matters are never simple, and this change took me an
      unreasonably long time to get right.  There are some details in
      Note [The interactive package] in HscTypes.
    • Simon Peyton Jones's avatar
      Further improve the "same-occurrence" error messages (Trac #8278) · 322b48b9
      Simon Peyton Jones authored
      Sometimes we actually have a good SrcSpan for the type constructor
      and reporting that is better than just reporting which module it
      was defined on
    • Simon Peyton Jones's avatar
    • Simon Peyton Jones's avatar
      Improve documentation of :module etc (Trac #8622) · 0ec53020
      Simon Peyton Jones authored
      I did quite a bit of restructuring, as well as adding
      the note specifically referred to in #8622
    • Simon Peyton Jones's avatar
      Comment typo · 0f737cef
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Further refine the test for 'given' equalities · 5d2fb2ee
      Simon Peyton Jones authored
      Trac #8651 revealed that my previous fix (itself in response to #8644)
      wasn't quite right.  The plan, using the CtOrigin to identify
      constraints arising from flattening, is described in TcSimplify,
      Note [When does an implication have given equalities?]
    • Austin Seipp's avatar
      Document Proxy# (#8658) · d4f0fcf3
      Austin Seipp authored
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
  3. 08 Jan, 2014 1 commit
  4. 07 Jan, 2014 12 commits
  5. 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.
  6. 02 Jan, 2014 3 commits
  7. 31 Dec, 2013 1 commit
  8. 30 Dec, 2013 1 commit
  9. 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
  10. 27 Dec, 2013 1 commit
    • 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