1. 26 Apr, 2006 1 commit
  2. 27 Apr, 2006 1 commit
  3. 25 Apr, 2006 2 commits
  4. 21 Apr, 2006 1 commit
  5. 20 Apr, 2006 4 commits
  6. 18 Apr, 2006 8 commits
  7. 14 Apr, 2006 4 commits
  8. 12 Apr, 2006 3 commits
    • simonpj@microsoft.com's avatar
      Cosmetics in SpecConstr · 48967672
      simonpj@microsoft.com authored
      SpecConstr currently uses substExpr for tiresome reasons to do with
      GADTs.  Unfortunately the substExpr generates some WARNINGS (when DEBUG)
      is on, because we aren't adding all the in-scope Ids to the in-scope
      set of the substitution.
      When we move to FC these substExprs will go away, so I'm not going to
      worry about this now.
    • simonpj@microsoft.com's avatar
      Improve pruning of case alternatives to account for GADTs · 2763f56d
      simonpj@microsoft.com authored
        data T a where
          T1 :: T Int
          T2 :: T Bool
          T3 :: T Char
        f :: T Bool -> Int
        f x = case x of
      	  DEFAULT -> ...
      	  T2 -> 3
      Here the DEFAULT case covers multiple constructors (T1,T3), but none 
      of them can match a scrutinee of type (T Bool).  So we can prune away
      the default case altogether.
      In implementing this, I re-factored this bit of the simplifier, elminiating
      prepareAlts from SimplUtils, and putting all the work into simplAlts in
      The proximate cause was a program written by Manuel using PArrays
    • Simon Marlow's avatar
      Fix a bug in optimising division to shift right · 91a9aeeb
      Simon Marlow authored
      Division by an integral log2 can't be directly optimised to a shift
      right, because shift right behaves like a division that rounds to
      negative infinity, whereas we want one that rounds to zero.  Fix this
      by adding (divisor-1) to the dividend when it is negative before
      shifting.  We do this without jumps, generating very slightly worse
      code than gcc, which uses conditional moves on CPUs that support it.
  9. 11 Apr, 2006 2 commits
    • Simon Marlow's avatar
      remove a trace · 92e1b7ac
      Simon Marlow authored
    • simonpj@microsoft.com's avatar
      Allow IO to be wrapped in a newtype in foreign import/export · fb0f3349
      simonpj@microsoft.com authored
      Up to now, the silent unwrapping of newtypes in foreign import/export
      has been limited to data values.  But it's useful for the IO monad
      	newtype MyIO a = MIO (IO a)
      	foreign import foo :: Int -> MyIO Int
      This patch allows the IO monad to be
      wrapped too. This applies to foreign import "dynamic" and "wrapper", 
         foreign import "wrapper" foo :: MyIO () -> HisIO (FunPtr (MyIO ())) 
      Warning: I did on the plane, and I'm no longer sure if its 100% 
      complete, so needs more testing.  In particular the wrapper/dynamic bit.
  10. 02 Apr, 2006 1 commit
    • simonpj@microsoft.com's avatar
      Improve newtype deriving · aa2c486e
      simonpj@microsoft.com authored
      Ross Paterson pointed out a useful generalisation of GHC's 
      newtype-deriving mechanism.  This implements it.  The idea
      is to allow
      	newtype Wrap m a = Wrap (m a) deriving (Monad, Eq)
      where the representation type doesn't start with a type
      Actually GHC already *did* implement this, but the eta-ok
      check in TcDeriv missed a case, so there was a lurking bug.
      This patches fixes the documentation too.  drvrun019 tests.
  11. 11 Apr, 2006 1 commit
  12. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.