1. 24 Jul, 2010 1 commit
  2. 21 Jul, 2010 3 commits
    • simonpj@microsoft.com's avatar
      Comments only · 58879838
      simonpj@microsoft.com authored
    • simonpj@microsoft.com's avatar
      Fix inlining for default methods · 0d3f8129
      simonpj@microsoft.com authored
      This was discombobulated by a patch a week ago;
      now fixed, quite straightforwardly.  See
      Note [Default methods and instances]
    • simonpj@microsoft.com's avatar
      Allow reification of existentials and GADTs · 0237ed67
      simonpj@microsoft.com authored
      It turns out that TH.Syntax is rich enough to express even GADTs,
      provided we express them in equality-predicate form.  So for
        data T a where
           MkT1 :: a -> T [a]
           MkT2 :: T Int
      will appear in TH syntax like this
        data T a = forall b. (a ~ [b]) => MkT1 b
                 | (a ~ Int) => MkT2
      While I was at it I also improved the reification of types,
      so that we use TH.TupleT and TH.ListT when we can.
  3. 15 Jul, 2010 1 commit
  4. 13 Jul, 2010 2 commits
  5. 07 Jul, 2010 2 commits
  6. 08 Jul, 2010 1 commit
    • Sergei Trofimovich's avatar
      alpha: switch handling of 'foreign import wrapper' (FIW) to libffi · a8dc46dc
      Sergei Trofimovich authored
      I tried to build ghc-6.12.3 and found out FIW part of code
      does not compile anymore. It uses absent functions under #ifdef.
      Instead of fixing it I just switched to libffi. Result built successfully
      and passed 'foreign import wrapper' test I wrote for trac ticket #3516.
      I didn't try to build -HEAD yet, but this patch only removes code, so
      it should not make -HEAD worse.
  7. 25 Jun, 2010 1 commit
  8. 15 Jun, 2010 1 commit
  9. 14 Jun, 2010 1 commit
  10. 31 May, 2010 2 commits
    • simonpj@microsoft.com's avatar
      Fix Trac #4099: better error message for type functions · 6270b3e3
      simonpj@microsoft.com authored
      Now we only want about "T is a type function and might not be
      injective" when matchin (T x) against (T y), which is the case
      that is really confusing.
    • simonpj@microsoft.com's avatar
      Robustify the treatement of DFunUnfolding · a90dc390
      simonpj@microsoft.com authored
      See Note [DFun unfoldings] in CoreSyn.  The issue here is that 
      you can't tell how many dictionary arguments a DFun needs just
      from looking at the Arity of the DFun Id: if the dictionary is
      represented by a newtype the arity might include the dictionary
      and value arguments of the (single) method.
      So we need to record the number of arguments need by the DFun
      in the DFunUnfolding itself.  Details in 
         Note [DFun unfoldings] in CoreSyn
  11. 25 May, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Refactor (again) the handling of default methods · 78693246
      simonpj@microsoft.com authored
      This patch fixes Trac #4056, by 
       a) tidying up the treatment of default method names
       b) removing the 'module' argument to newTopSrcBinder
      The details aren't that interesting, but the result
      is much tidier. The original bug was a 'nameModule' panic,
      caused by trying to find the module of a top-level name.
      But TH quotes generate Internal top-level names that don't
      have a module, and that is generally a good thing.  
      Fixing that in turn led to the default-method refactoring,
      which also makes the Name for a default method be handled
      in the same way as other derived names, generated in BuildTyCl
      via a call newImplicitBinder.  Hurrah.
  12. 11 May, 2010 1 commit
  13. 10 May, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Re-engineer the derived Ord instance generation code (fix Trac #4019) · f3c7ab8d
      simonpj@microsoft.com authored
      As well as fixing #4019, I rejigged the way that Ord instances are
      generated, which should make them faster in general.  See the 
      Note [Generating Ord instances].
      I tried to measure the performance difference from this change, but
      the #4019 fix only removes one conditional branch per iteration, and
      I couldn't measure a consistent improvement.  But still, tihs is
      better than before.
  14. 06 May, 2010 7 commits
  15. 09 Apr, 2010 3 commits
  16. 12 Apr, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Fix Trac #3950: unifying types of different kinds · f38eb882
      simonpj@microsoft.com authored
      I was assuming that the unifer only unified types of the 
      same kind, but now we can "defer" unsolved constraints that
      invariant no longer holds.  Or at least is's more complicated
      to ensure.  
      This patch takes the path of not assuming the invariant, which
      is simpler and more robust.  See
      Note [Mismatched type lists and application decomposition]
  17. 20 Mar, 2010 1 commit
  18. 17 Mar, 2010 1 commit
  19. 09 Mar, 2010 1 commit
  20. 04 Mar, 2010 2 commits
    • simonpj@microsoft.com's avatar
      Comments only · b4556cac
      simonpj@microsoft.com authored
    • simonpj@microsoft.com's avatar
      Refactor part of the renamer to fix Trac #3901 · f1cc3eb9
      simonpj@microsoft.com authored
      This one was bigger than I anticipated!  The problem was that were
      were gathering the binders from a pattern before renaming -- but with
      record wild-cards we don't know what variables are bound by C {..}
      until after the renamer has filled in the "..".
      So this patch does the following
      * Change all the collect-X-Binders functions in HsUtils so that
        they expect to only be called *after* renaming.  That means they
        don't need to return [Located id] but just [id].  Which turned out
        to be a very worthwhile simplification all by itself.
      * Refactor the renamer, and in ptic RnExpr.rnStmt, so that it
        doesn't need to use collectLStmtsBinders on pre-renamed Stmts.
      * This in turn required me to understand how GroupStmt and
        TransformStmts were renamed.  Quite fiddly. I rewrote most of it;
        result is much shorter.
      * In doing so I flattened HsExpr.GroupByClause into its parent
        GroupStmt, with trivial knock-on effects in other files.
  21. 01 Mar, 2010 1 commit
  22. 10 Feb, 2010 4 commits
    • simonpj@microsoft.com's avatar
      Improve error dump in TcEnv · d259dd70
      simonpj@microsoft.com authored
    • simonpj@microsoft.com's avatar
      Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845 · 836b1e90
      simonpj@microsoft.com authored
      To print HsTypes correctly we should remember whether the Kind on
      a HsTyVarBndr came from type inference, or was put there by the
      user.  See Note [Printing KindedTyVars] in HsTypes.  So instead of
      changing a UserTyVar to a KindedTyVar during kind checking, we
      simply add a PostTcKind to the UserTyVar.
      The change was provoked by Trac #3830, although other changes
      mean that #3830 gets a diferent and better error message now.
      So this patch is simply doing the Right Thing for the future.
      This patch also fixes Trac #3845, which was caused by a *type splice*
      not remembering the free *term variables* mentioned in it.  Result
      was that we build a 'let' when it should have been 'letrec'.
      Hence a new FreeVars field in HsSpliceTy.
      While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
      on HsSpliceTy instead, just like on the UserTyVar.
    • simonpj@microsoft.com's avatar
      Comments only · 90686adf
      simonpj@microsoft.com authored
    • simonpj@microsoft.com's avatar
      Several TH/quasiquote changes · 6f8ff0bb
      simonpj@microsoft.com authored
      a) Added quasi-quote forms for
         e.g.   f :: [$qq| ... |]
      b) Allow Template Haskell pattern quotes (but not splices)
         e.g.  f x = [p| Int -> $x |]
      c) Improve pretty-printing for HsPat to remove superfluous
         parens.  (This isn't TH related really, but it affects
         some of the same code.)
      A consequence of (a) is that when gathering and grouping declarations
      in RnSource.findSplice, we must expand quasiquotes as we do so.
      Otherwise it's all fairly straightforward.  I did a little bit of
      refactoring in TcSplice.
      User-manual changes still to come.
  23. 22 Jan, 2010 1 commit