1. 20 May, 2005 3 commits
    • simonpj's avatar
      [project @ 2005-05-20 11:42:57 by simonpj] · 02a06a56
      simonpj authored
      Improve the GHCi interaction
      
      		Merge to STABLE?
      
      This fix addresses Sourceforge #1156554 "GHCi: No instance for (Show (IO ()))",
      and simultaneously improves the top-level interaction in two other ways:
      
      - Only one error can show up (previously there could be two)
      
      - If an I/O action gives a Showable result, the result is printed
        (provided it isn't ()).  So
      	prompt> return 4
        prints 4, rather than nothing
      
      - For command-line 'let' and 'x<-e' forms, if exactly one variable
        is bound, we print its value if it is Showable and not ()
      	prompt> let x = 4
      	4
      	prompt> x <- return 5
      	5
      02a06a56
    • simonpj's avatar
      [project @ 2005-05-20 11:32:03 by simonpj] · 40d3a06b
      simonpj authored
      Liberalise the defaulting rules for GHCi
      
      		Merge to STABLE?
      
      The H98 defaulting rules are these.  Group constraints of the form (C v),
      for some particular type variable v. Then default v if
      
      a) v appears only in this group (no implicit params or D [v])
      b) at least one of the C's is numeric
      c) all the C's are standard
      
      GHCi changed rules (b) to
      
      (b') at least one of the C's is numeric, or Eq,Ord,Show
      
      This commit further liberalises GHCi to change (c):
      
      (c') any of the C's are standard
      
      Otherwise the existence of a non-standard class (e.g. Random) is enough
      to kill defaulting altogether.
      40d3a06b
    • simonpj's avatar
      [project @ 2005-05-20 11:31:46 by simonpj] · 79cbcc81
      simonpj authored
      Comments only
      79cbcc81
  2. 19 May, 2005 8 commits
    • simonmar's avatar
      [project @ 2005-05-19 13:46:24 by simonmar] · 88825a2e
      simonmar authored
      Fix locking when unblocking a thread in take/putMVar.  Due to CPP
      nonsense the previous locking wasn't actually working, which lead to
      deadlock problems.  It now turns out that I can call unblockOne
      directly rather than needing unblockOneLocked (the lock on the MVar
      means I have exclusive access to the threads on its queue).
      88825a2e
    • simonmar's avatar
      [project @ 2005-05-19 13:21:55 by simonmar] · 3595da95
      simonmar authored
      - Move the call to threadPaused() from the scheduler into STG land,
        and put it in a new code fragment (stg_returnToSched) that we pass
        through every time we return from STG to the scheduler.  Also, the
        SAVE_THREAD_STATE() is now in stg_returnToSched which might save a
        little code space (at the expense of an extra jump for every return
        to the scheduler).
      
      - SMP: when blocking on an MVar, we now wait until the thread has been
        made fully safe and placed on the blocked queue of the MVar before
        we unlock the MVar.  This closes a race whereby another OS thread could
        begin waking us up before the current TSO had been properly tidied up.
      
      Fixes one cause of crashes when using MVars with SMP.  I still have a
      deadlock problem to track down.
      3595da95
    • simonmar's avatar
      [project @ 2005-05-19 11:17:20 by simonmar] · eab2c6c4
      simonmar authored
      SMP: omit the -pthread flag on Windows
      eab2c6c4
    • simonpj's avatar
      [project @ 2005-05-19 11:15:40 by simonpj] · 4a587049
      simonpj authored
      Tune up the reporting of unused imports
      
      		Merge to STABLE
      	(I think the earlier change made it across)
      	(PS: the commit also does some trimming of
      	redundant imports.  If they don't merge, just
      	discard them.)
      
      My earlier fixes to the reporting of unused imports still missed
      some obscure cases, some of which are now fixed by this commit.
      I had to make the import-provenance data type yet richer, but in
      fact it has more sharing now, so it may be cheaper on space.
      
      There's still one infelicity. Consider
      		import M( x )
      		imoprt N( x )
      where the same underlying 'x' is involved in both cases.  Currently we
      don't report a redundant import, because dropping either import would
      change the qualified names in scope (M.x, N.x). But if the qualified
      names aren't used, the import is indeed redundant. Sadly we don't know
      that, because we only know what Names are used.  Left for the future!
      There's a comment in RnNames.warnDuplicateImports
      
      This commit also trims quite a few redundant imports disovered
      by the new setup.
      4a587049
    • simonmar's avatar
      [project @ 2005-05-19 11:13:23 by simonmar] · f01b31dd
      simonmar authored
      Add required include: #include "RtsFlags.h"
      f01b31dd
    • simonmar's avatar
      [project @ 2005-05-19 11:09:27 by simonmar] · e615ba8a
      simonmar authored
      Fix SMP build on Windows
      e615ba8a
    • simonpj's avatar
      [project @ 2005-05-19 07:58:35 by simonpj] · f7ccc078
      simonpj authored
      Catch an exception in Template Haskell code
      
      		Merge to STABLE
      
      If the code run by a Template Haskell splice fails with, say,
      a pattern-match failure, we should not report it as a GHC panic.
      It's a bug in the user's program.
      
      This commit fixes up the exception handling to do the right thing.
      
      Fixes SourceForge item #1201666
      
      TH_fail tests it.
      f7ccc078
    • simonpj's avatar
      [project @ 2005-05-19 07:56:58 by simonpj] · ead9311d
      simonpj authored
      Make sure the default methods are in scope
      	in a Template Haskell splice
      
      		Merge to STABLE
      
      This was just a typo really; in TcRnDriver.tcTopSrcDecls there were two
      tcl_envs, but one had a different name so we got the less up-to-date one.
      
      Fixes SourceForge item #1194808
      
      TH_spliceInst tests it.
      ead9311d
  3. 18 May, 2005 9 commits
  4. 17 May, 2005 17 commits
  5. 16 May, 2005 3 commits
    • simonmar's avatar
      [project @ 2005-05-16 14:40:06 by simonmar] · df0ba686
      simonmar authored
      document +RTS -I
      df0ba686
    • simonmar's avatar
      [project @ 2005-05-16 14:39:54 by simonmar] · 37c4e49e
      simonmar authored
      Set BINDIST_DOC_WAYS appropriately depending on which doc-building
      tools are available.  The default is to build all of html, ps & pdf if
      possible.
      37c4e49e
    • simonmar's avatar
      [project @ 2005-05-16 14:27:07 by simonmar] · 33a84b8c
      simonmar authored
      Allow the amount of idle time which must pass before we force a major
      GC to be configured at runtime with the +RTS -I<secs> option.
      
      The idle GC only happens in the threaded RTS, and it is useful because
      it can make finalizers run more promptly, and also detect cases of
      deadlock.  Without the idle GC, Haskell computation must be taking
      place in order for finalizers to run or deadlock to be detected, and
      the only way some Haskell computation can take place is usually by
      in-calls.
      
      +RTS -I0 turns off the idle GC, the default is +RTS -I0.3.
      
      We might need to add more tuning if it turns out that the idle GC is
      problematic, for example we don't check how long the GC actually took,
      and we should probably back off if major GCs are taking too long and
      adversely affecting interactive responsiveness.
      33a84b8c