1. 18 Aug, 2004 3 commits
    • simonmar's avatar
      [project @ 2004-08-18 13:14:21 by simonmar] · 77cfaa5c
      simonmar authored
      Add cmm directory
      77cfaa5c
    • simonmar's avatar
      [project @ 2004-08-18 10:07:29 by simonmar] · 831dbf15
      simonmar authored
      Remove extra semicolon; exposed by other recent changes.
      831dbf15
    • simonpj's avatar
      [project @ 2004-08-18 09:33:03 by simonpj] · 370765b2
      simonpj authored
      -------------------------------
      		Fix a fundep bug
      	-------------------------------
      
      		MERGE TO STABLE
      
      Big thank-you to Martin Sulzmann for finding this functional dependency bug.
      
      The new defn of FunDeps.Equation is:
      	type Equation = (TyVarSet, [(Type, Type)])
      Before it was (TyVarSet, Type, Type), so each pair of types was separately
      quantified (wrong).
      
      It's important that we have a *list* of pairs of types.  Consider
       	class C a b c | a -> b c where ...
      	instance C Int x x where ...
      Then, given the constraint (C Int Bool v) we should improve v to Bool,
      via the equation ({x}, [(Bool,x), (v,x)])
      This would not happen if the class had looked like
      	class C a b c | a -> b, a -> c
      
      
      Test in typecheck/should_compile/tc180
      370765b2
  2. 17 Aug, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-08-17 15:23:47 by simonpj] · 59c796f8
      simonpj authored
      -------------------------------
      	Use merge-sort not quicksort
      	Nuke quicksort altogether
      	-------------------------------
      
      Quicksort has O(n**2) behaviour worst case, and this occasionally bites.
      In particular, when compiling large files consisting only of static data,
      we get loads of top-level delarations -- and that led to more than half the
      total compile time being spent in the strongly connected component analysis
      for the occurrence analyser.  Switching to merge sort completely solved the
      problem.
      
      I've nuked quicksort altogether to make sure this does not happen again.
      59c796f8
  3. 16 Aug, 2004 6 commits
    • simonpj's avatar
      [project @ 2004-08-16 16:26:51 by simonpj] · 2199f17d
      simonpj authored
      -------------------------------
      	Add instance information to :i
       	Get rid of the DeclPool
      	-------------------------------
      
      
      1.  Add instance information to :info command.  GHCi now prints out
          which instances a type or class belongs to, when you use :i
      
      2.  Tidy up printing of unqualified names in user output.
          Previously Outputable.PrintUnqualified was
      	type PrintUnqualified = Name -> Bool
          but it's now
      	type PrintUnqualified = ModuleName -> OccName -> Bool
          This turns out to be tidier even for Names, and it's now also usable
          when printing IfaceSyn stuff in GHCi, eliminating a grevious hack.
      
      3.  On the way to doing this, Simon M had the great idea that we could
          get rid of the DeclPool holding pen, which held declarations read from
          interface files but not yet type-checked.   We do this by eagerly
          populating the TypeEnv with thunks what, when poked, do the type
          checking.   This is just a logical continuation of lazy import
          mechanism we've now had for some while.
      
      The InstPool and RulePool still exist, but I plan to get rid of them in
      the same way.  The new scheme does mean that more rules get sucked in than
      before, because previously the TypeEnv was used to mean "this thing was needed"
      and hence to control which rules were sucked in.  But now the TypeEnv is
      populated more eagerly => more rules get sucked in.  However this problem
      will go away when I get rid of the Inst and Rule pools.
      
      I should have kept these changes separate, but I didn't.  Change (1)
      affects mainly
      	TcRnDriver, HscMain, CompMan, InteractiveUI
      whereas change (3) is more wide ranging.
      2199f17d
    • simonmar's avatar
      [project @ 2004-08-16 11:57:19 by simonmar] · 36fc368e
      simonmar authored
      Avoid casting lvalues; gcc 3.4 issues warnings for it.
      36fc368e
    • simonmar's avatar
      [project @ 2004-08-16 11:19:24 by simonmar] · e3d95da8
      simonmar authored
      Define <arch>_TARGET_ARCH and <os>_TARGET_OS by default when CPP'ing.
      This avoids the main reason for needing to #include config.h into
      Haskell source, so most files that previously just #include "config.h" can now
      
        #if __GLASGOW_HASKELL__ < 603
        #include "config.h"
        #endif
      e3d95da8
    • simonpj's avatar
      [project @ 2004-08-16 09:53:47 by simonpj] · 4e325538
      simonpj authored
      -------------------------------
      	Add instance information to :i
       	Get rid of the DeclPool
      	-------------------------------
      
      
      1.  Add instance information to :info command.  GHCi now prints out
          which instances a type or class belongs to, when you use :i
      
      2.  Tidy up printing of unqualified names in user output.
          Previously Outputable.PrintUnqualified was
      	type PrintUnqualified = Name -> Bool
          but it's now
      	type PrintUnqualified = ModuleName -> OccName -> Bool
          This turns out to be tidier even for Names, and it's now also usable
          when printing IfaceSyn stuff in GHCi, eliminating a grevious hack.
      
      3.  On the way to doing this, Simon M had the great idea that we could
          get rid of the DeclPool holding pen, which held declarations read from
          interface files but not yet type-checked.   We do this by eagerly
          populating the TypeEnv with thunks what, when poked, do the type
          checking.   This is just a logical continuation of lazy import
          mechanism we've now had for some while.
      
      The InstPool and RulePool still exist, but I plan to get rid of them in
      the same way.  The new scheme does mean that more rules get sucked in than
      before, because previously the TypeEnv was used to mean "this thing was needed"
      and hence to control which rules were sucked in.  But now the TypeEnv is
      populated more eagerly => more rules get sucked in.  However this problem
      will go away when I get rid of the Inst and Rule pools.
      
      I should have kept these changes separate, but I didn't.  Change (1)
      affects mainly
      	TcRnDriver, HscMain, CompMan, InteractiveUI
      whereas change (3) is more wide ranging.
      4e325538
    • simonpj's avatar
      [project @ 2004-08-16 09:51:20 by simonpj] · d32c5227
      simonpj authored
      Commments only
      d32c5227
    • simonpj's avatar
      [project @ 2004-08-16 09:41:19 by simonpj] · 228c4743
      simonpj authored
      Fix problem with :i for (:)
      228c4743
  4. 13 Aug, 2004 4 commits
  5. 12 Aug, 2004 4 commits
  6. 10 Aug, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-08-10 09:02:36 by simonmar] · c9a32c38
      simonmar authored
      Fix problem with inline foreign-call changes yesterday.  Foreign call
      args sometimes have to be modified using shimFCallArg - nowadays this
      is done at code generation time, whereas it used to be done at
      pretty-printing time.
      c9a32c38
  7. 09 Aug, 2004 2 commits
    • simonmar's avatar
      [project @ 2004-08-09 13:19:29 by simonmar] · 46d88d87
      simonmar authored
      Allow case-of-unsafe-ccall to compile to straight-line code, like it
      used to.  This has already been fixed on the backend-hacking-branch,
      but I'm doing it here so that it can be merged into the STABLE branch,
      where it will help to work around a bug.
      
      The bug is in CgExpr.lhs:primRetUnboxedTuple, which picks temporaries
      to assign the result of a ccall to.  The Cg monad doesn't have a uniq
      supply (in the HEAD), so we always pick the same temporaries.  This
      leads to clashes in complex function with multiple ccalls.  Again,
      this is already fixed in the backend-hacking-branch.  I don't see an
      easy fix for this bug.
      
      The compilation of case-of-unsafe-ccall doesn't suffer from this
      problem, and it will help work around some cases of the bug, so I'm
      going to merge this onto the STABLE branch after some testing.
      46d88d87
    • simonmar's avatar
      [project @ 2004-08-09 12:15:09 by simonmar] · dfd0efbe
      simonmar authored
      Put a "-- " before the location info, since the rest of the output
      looks like Haskell source.
      dfd0efbe
  8. 30 Jul, 2004 2 commits
  9. 28 Jul, 2004 2 commits
  10. 21 Jul, 2004 3 commits
  11. 19 Jul, 2004 2 commits
  12. 24 Jun, 2004 2 commits
  13. 23 Jun, 2004 1 commit
    • ross's avatar
      [project @ 2004-06-23 22:43:20 by ross] · 8000acbf
      ross authored
      arrow notation fixes (problems reported bu John Hughes):
      
      * allow an infixexp (exp0) to the left of -<.  This adds 4 more
        shift/reduce conflicts, because it makes if/lambda/let/case/proc
        before -< ambiguous.  This is the same sort of thing as
        "if x then y else z + 1", and as there shifting does the right thing.
      
      * described the grammar more precisely
      
      * fixed an example
      
      merge to STABLE
      8000acbf
  14. 22 Jun, 2004 2 commits
  15. 20 Jun, 2004 1 commit
  16. 02 Jun, 2004 3 commits
    • simonpj's avatar
      [project @ 2004-06-02 08:25:10 by simonpj] · 729a6eb1
      simonpj authored
      -----------------------------------------------
             Record whether data constructors are declared infix
      	-----------------------------------------------
      
      This allows us to generate the InfixC form in Template Hasekll.
      And for 'deriving' Read and Show, we now read and parse the infix
      form iff the constructor was declared infix, rather than just if
      it does not have the default fixity (as before).
      
      IfaceSyn changes slightly, so that IfaceConDecl can record their
      fixity, so there are trivial changes scattered about, and
      you'll need to recompile everything.
      
      In TysWiredIn I took the opportunity to simplify pcDataCon slightly,
      by eliminating the unused Theta argument.
      729a6eb1
    • simonpj's avatar
      [project @ 2004-06-02 08:23:43 by simonpj] · 5568d10f
      simonpj authored
      -------------------------------
      	Fix a grevious bug in DsMeta
      	which caused a seg fault
      	-------------------------------
      
      The bug was an incorrectly declared type for one of the Template
      Haskell construction functions in DsMeta (repRecCon, repRecUpd)
      and some associated jiggery pokery.
      
      -dcore-lint showed it up nicely, because the desugarer generated
      ill-typed code.
      
      DsMeta PrelNames TH.Lib
      5568d10f
    • simonpj's avatar
      [project @ 2004-06-02 08:09:58 by simonpj] · e25d4444
      simonpj authored
      Comments only
      e25d4444
  17. 01 Jun, 2004 1 commit
    • igloo's avatar
      [project @ 2004-06-01 23:22:30 by igloo] · 5ca86c67
      igloo authored
      Add missing functions to TH export list (mostly spotted by Duncan Coutts).
      
      Update TH test output.
      
      Add TH support for patterns with type signatures, and test for same
      (requested by Isaac Jones).
      
      Add TH support for pattern guards, and tests for same
      (requested by Isaac Jones).
      
      Add infix patterns to TH datatypes.
      
      Added Lift instances for 2- to 7-tuples (requested by Duncan Coutts).
      5ca86c67