1. 16 Aug, 2006 5 commits
  2. 15 Aug, 2006 7 commits
    • simonpj@microsoft.com's avatar
      Allow class and instance decls in hs-boot files · dfcf8852
      simonpj@microsoft.com authored
      For some reason, in 6.5 the manual said you could put a class decl in
      an interface file, but not an instance decl; whereas the implementation
      was exactly the othe way round.
      
      This patch makes it possible to put *both* class and instance decls
      in an interface file. 
      
      I also did a bit of re-factoring; comparing the declarations in the
      hs-boot and hs file is now done by converting to IfaceSyn, because we
      have good comparison operations for IfaceSyn already implemented.
      This fixed a bug that previously let through an inconsistent declaration 
      of a data type.
      
      The remaining infelicity concerns "abstract" TyCons.  They are a bit
      of a hack anyway; and Classes are not handled in the same way.  Need
      to think about this, but I think it's probably ok as it stands.
      
      dfcf8852
    • simonpj@microsoft.com's avatar
      Reject derivable type classes with higher-rank methods · 4bcaad0c
      simonpj@microsoft.com authored
      Trac #864 suggested a derivable type class with a higher-rank method.
      
      In principle this is quite do-able, but in practice the mechanism works
      by generating source code and then doing type inference.  To make this work
      with higher-rank types would require impredicative polymorphism. And we 
      do have that, so it could probably be made to work by generating (source-level)
      type annotations.  But it's real work, so I'm settling for generating a
      decent error message rather than crashing.
      
      4bcaad0c
    • simonpj@microsoft.com's avatar
      SpecConstr now specialises on constants and lambdas · c17dc70a
      simonpj@microsoft.com authored
      Roman inspired me to beef up SpecConstr to deal with
      a) constant arguments
      b) lambda arguments
      
      This is described in elaborate comments in the file:
       	Note [Specialising for constant parameters]
      	Note [Specialising for lambda parameters]
      
      I also took the opportunity to fix the usage analysis done by
      SpecConstr, which was only handling the top-level correctly.
      Now it does nesting too.
      
      c17dc70a
    • simonpj@microsoft.com's avatar
      Fix two bugs in rule-matching · 969baa16
      simonpj@microsoft.com authored
      These two typo-like bugs have been there for a long time!
      
        One concerns the selection of overlapping rules, 
        which was back to front
      
        The other was name-lining-up bug in the Case case of matching
      
      This patch also arranges to export matchN. 
        (Not a good name, but still!)
      
      969baa16
    • simonpj@microsoft.com's avatar
    • simonpj@microsoft.com's avatar
      Make UniqSM into a proper monad · 0d7c6cea
      simonpj@microsoft.com authored
      0d7c6cea
    • simonpj@microsoft.com's avatar
  3. 14 Aug, 2006 5 commits
    • simonpj@microsoft.com's avatar
      Be more conservative about duplicating continuations · da107045
      simonpj@microsoft.com authored
      Roman found that GHC was duplicating continuations that arose (essentially)
      from uses of 'seq', or strict constructors.  This fixes the problem;
      see the comments mkDupableCont (the Select case with a single alternative).
      
      I'm a little concerned that this may also miss useful case-of-case
      tranformations, so I'd like to know if anyone finds that this patch
      makes performance worse.
      
      To make it a bit more gung-ho, one could check for all the binders
      being dead, before choosing this new, conservative alternative.
      
      da107045
    • simonpj@microsoft.com's avatar
      Inline into tail-called constructor args · 098d99aa
      simonpj@microsoft.com authored
      Consider
      	x = case y of { True -> (p,q); ... }
      
      The occurrence analyser was marking p,q as 'Many', because they args
      of a constructor in an RhsCtxt.  But actually they aren't in a RhsCtxt,
      and in this case it's better to inline.
      098d99aa
    • simonpj@microsoft.com's avatar
      Improve exprIsCheap · 25ce05f7
      simonpj@microsoft.com authored
      exprIsCheap is meant to return True iff it's ok to push the expression
      inside a lambda.  But the previous version would return True of a nested
      construtor application like (1:2:3:[]), which isn't right.
      
      This patch re-factors the code somewhat, and fixes the bug.
      25ce05f7
    • bringert@cs.chalmers.se's avatar
      674100ec
    • simonpj@microsoft.com's avatar
      Improve error message in TcHsType · ef10d0a7
      simonpj@microsoft.com authored
      Fixes Trac #863.
      Test is tcfail162
      ef10d0a7
  4. 11 Aug, 2006 14 commits
  5. 10 Aug, 2006 9 commits