1. 19 Jul, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-07-19 16:44:50 by simonpj] · a7ecdf96
      simonpj authored
      WARNING: this is a big commit.  You might want 
      	to wait a few days before updating, in case I've 
      	broken something.
      
      	However, if any of the changes are what you wanted,
      	please check it out and test!
      
      This commit does three main things:
      
      1. A re-organisation of the way that GHC handles bindings in HsSyn.
         This has been a bit of a mess for quite a while.  The key new
         types are
      
      	-- Bindings for a let or where clause
      	data HsLocalBinds id
      	  = HsValBinds (HsValBinds id)
      	  | HsIPBinds  (HsIPBinds id)
      	  | EmptyLocalBinds
      
      	-- Value bindings (not implicit parameters)
      	data HsValBinds id
      	  = ValBindsIn  -- Before typechecking
      		(LHsBinds id) [LSig id]	-- Not dependency analysed
      					-- Recursive by default
      
      	  | ValBindsOut	-- After typechecking
      		[(RecFlag, LHsBinds id)]-- Dependency analysed
      
      2. Implement Mark Jones's idea of increasing polymoprhism
         by using type signatures to cut the strongly-connected components
         of a recursive group.  As a consequence, GHC no longer insists
         on the contexts of the type signatures of a recursive group
         being identical.
      
         This drove a significant change: the renamer no longer does dependency
         analysis.  Instead, it attaches a free-variable set to each binding,
         so that the type checker can do the dep anal.  Reason: the typechecker
         needs to do *two* analyses:
      	one to find the true mutually-recursive groups
      		(which we need so we can build the right CoreSyn)
      	one to find the groups in which to typecheck, taking
      		account of type signatures
      
      3. Implement non-ground SPECIALISE pragmas, as promised, and as
         requested by Remi and Ross.  Certainly, this should fix the 
         current problem with GHC, namely that if you have
      	g :: Eq a => a -> b -> b
         then you can now specialise thus
      	SPECIALISE g :: Int -> b -> b
          (This didn't use to work.)
      
         However, it goes further than that.  For example:
      	f :: (Eq a, Ix b) => a -> b -> b
         then you can make a partial specialisation
      	SPECIALISE f :: (Eq a) => a -> Int -> Int
      
          In principle, you can specialise f to *any* type that is
          "less polymorphic" (in the sense of subsumption) than f's 
          actual type.  Such as
      	SPECIALISE f :: Eq a => [a] -> Int -> Int
          But I haven't tested that.
      
          I implemented this by doing the specialisation in the typechecker
          and desugarer, rather than leaving around the strange SpecPragmaIds,
          for the specialiser to find.  Indeed, SpecPragmaIds have vanished 
          altogether (hooray).
      
          Pragmas in general are handled more tidily.  There's a new
          data type HsBinds.Prag, which lives in an AbsBinds, and carries
          pragma info from the typechecker to the desugarer.
      
      
      Smaller things
      
      - The loop in the renamer goes via RnExpr, instead of RnSource.
        (That makes it more like the type checker.)
      
      - I fixed the thing that was causing 'check_tc' warnings to be 
        emitted.
      a7ecdf96
  2. 18 Jul, 2005 2 commits
  3. 15 Jul, 2005 1 commit
  4. 14 Jul, 2005 3 commits
    • simonmar's avatar
      [project @ 2005-07-14 15:14:33 by simonmar] · 834e8207
      simonmar authored
      - -package P picks the latest version of P, instead of complaining
          if P is ambiguous.
      
        - -hide-package P hides all versions of P, instead of complaining
          if P is ambiguous.
      834e8207
    • simonmar's avatar
      [project @ 2005-07-14 15:12:20 by simonmar] · efbbd977
      simonmar authored
      - -package P hides all other versions of P (this was advertised
          in the documentation, but wasn't actually implemented in 6.4)
      
        - if multiple packages with the same name are still exposed after
          the flags have been processed, then all except the latest version
          are hidden.
      efbbd977
    • simonmar's avatar
      [project @ 2005-07-14 10:38:03 by simonmar] · a31c721c
      simonmar authored
      Fix mulMayOflo() on 64-bit archs.  This fixes the arith003 failures on x86_64.
      a31c721c
  5. 13 Jul, 2005 3 commits
  6. 12 Jul, 2005 18 commits
  7. 11 Jul, 2005 12 commits
    • panne's avatar
      [project @ 2005-07-11 20:33:45 by panne] · 239c42e0
      panne authored
      After some experiments, it seems like we're stealing too many registers from
      newer GCCs on SPARC, leading to
      
         "unable to find a register to spill in class `GENERAL_REGS'"
      
      errors. The fix is to leave l6 and l7 to GCC. Tested with a full 2-stage
      bootstrap (including OpenGL/GLUT packages) on SPARC Solaris 8 with GCC 3.4.4.
      
      A test case for this (which I'm too lazy/tired to commit) is:
      
         module Blah ( foo ) where
         import Foreign.Ptr ( FunPtr )
         type Bar = Int -> Double -> Double -> Double -> IO ()
         foreign import ccall unsafe "dynamic" foo :: FunPtr Bar -> Bar
      
      SimonM: MERGE TO STABLE (if nobody yells)
      239c42e0
    • simonmar's avatar
      [project @ 2005-07-11 15:57:38 by simonmar] · c7720145
      simonmar authored
      Avoid calling threadPaused() on exit from STG land if we're just
      switching to the interpreter, and conversely call threadPaused() in
      the interpreter if we're returing to the scheduler for anything other
      than switching to STG.
      
      This will probably fix the recent slowdown in GHCi (ioref001 test, for
      example).  It was broken when we moved the threadPaused() call into
      STG from the scheduler, so it only affects the HEAD.
      c7720145
    • simonmar's avatar
      [project @ 2005-07-11 15:34:07 by simonmar] · 86024676
      simonmar authored
      make_constr_itbls: 64-bit fix (size of info table was hardcoded)
      86024676
    • simonmar's avatar
      [project @ 2005-07-11 14:21:54 by simonmar] · cab13f0f
      simonmar authored
      byte code info tables for x86_64 (same as i386)
      cab13f0f
    • simonmar's avatar
      [project @ 2005-07-11 14:08:07 by simonmar] · 10878260
      simonmar authored
      Turn on GHCi for x86_64
      10878260
    • simonmar's avatar
      [project @ 2005-07-11 13:53:24 by simonmar] · 0af6ff59
      simonmar authored
      GHCi staggers to its feet on x86_64.
      
      The problem is that in the small code model on x86_64, all symbol
      relocations are 32-bit, because the program is assumed to fit into
      2Gb.  However, shared libraries are linked outside the 2Gb range, and
      the linker arranges that references to shared library symbols either
      go via a jump table (for code references) or are copied into the 2Gb
      area (for data references).
      
      In GHCi's linker, We can use a jump table for the function symbols,
      but we can't copy the data symbols because they've already been
      relocated to point to the shared library.  What's more, we can't tell
      whether a symbol reference is to code or data - this information is
      only available from the shared library itself.
      
      Fortunately, at least HSbase.o doesn't have any data references to
      shared libraries (at least on the Linux distro I'm using), so I can at
      least get GHCi up and limping.
      0af6ff59
    • simonmar's avatar
      [project @ 2005-07-11 12:29:28 by simonmar] · b8105b2b
      simonmar authored
      awakenBlockedQueue(): check for NULL.  This is a hack to workaround a
      bug that occurs when async exceptions, unsafePerformIO, and
      interruptible operations are used together.  See the comment in
      Exceptions.cmm and bug #1235728 for more details.
      b8105b2b
    • simonpj's avatar
      [project @ 2005-07-11 10:47:20 by simonpj] · 65785a09
      simonpj authored
      Wibbles to unifyFunTy error messages
      65785a09
    • simonpj's avatar
      [project @ 2005-07-11 10:46:42 by simonpj] · 1360bef3
      simonpj authored
      Improvements to speakN, define speakNOf, move plural from TcSimplify
      1360bef3
    • simonmar's avatar
      [project @ 2005-07-11 10:25:43 by simonmar] · b4ab2c41
      simonmar authored
      mingw32: ignore isDoesNotExistError failure from
      GHC.ConsoleHandler.flushConsole
      
      Submitted-by: Brian Smith <brianlsmith at gmail.com>
      b4ab2c41
    • simonpj's avatar
      [project @ 2005-07-11 09:54:43 by simonpj] · 9fe510d1
      simonpj authored
      Improve the error message from unifyFunTys.  Previously we got a really
      horrible message from this:
      	  t = ((\Just x -> x) :: Maybe a -> a) (Just 1)
          
      Try.hs:1:6:
          Couldn't match the rigid variable `a' against `t -> t1'
            Expected type: a
            Inferred type: t -> t1
      
      Now it's much better:
      
      Try.hs:14:6:
          The lambda expression `\ Just x -> ...' has two arguments,
          but its type `Maybe a -> a' has only one
          In the expression: (\ Just x -> x) :: Maybe a -> a
      
      
      tcfail140 tests some cases
      9fe510d1
    • simonpj's avatar
      [project @ 2005-07-11 09:48:57 by simonpj] · a6f3a1f8
      simonpj authored
      Fix a bug in the renamer for parallel list comprehensions
      	MERGE TO STABLE
      
      It's surprinsingly tricky to combine 
        a) The parallel scopes for par-list-comps
      with
        b) The general form of the renamer types, whereby
           scoped constructs work like
      	 rnPat :: Pat -> RnM (thing,FreeVars)
      	       -> RnM ((Pat,thing), FreeVars)
           This general shape neatly allows rnPat to
           extend the envt, report unused variables from
           the 'thing' inside, and return the correct set
           of free variables
      
      But combining (a) and (b) is tricky, and was plain wrong before.
      a6f3a1f8