1. 17 Mar, 2000 1 commit
  2. 16 Mar, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-03-16 17:27:12 by simonmar] · 3ddfdc19
      simonmar authored
      Raise an exception in any thread that is about to be garbage
      collected.
      
      	- threads blocked on MVars that are otherwise garbage
      	  will receive a BlockedOnDeadMVar exception.
      
      	- threads blocked on Black Holes must be in some kind
      	  of deadlock, so we send them a NonTermination exception.
      3ddfdc19
    • rrt's avatar
      [project @ 2000-03-16 16:22:15 by rrt] · 6e292d7b
      rrt authored
      Got rid of an odir problem when building PrelMain as a DLL.
      6e292d7b
  3. 14 Mar, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-03-14 12:16:00 by simonmar] · 716d91c2
      simonmar authored
      Simplfy the mutable array story:
      
      	- rename MutableArray to STArray (and similarly
      	  for all operations on MutableArray, eg newArray
      	  is now newSTArray).
      
      	- remove the extra level of indirection between
      	  STArrays and MutableArrays.
      
      	- remove the MutableArray interface from
      	  hslibs/lang/MutableArray.  This module will go
      	  away soon - Andy, don't bother porting it to Hugs.
      716d91c2
    • sof's avatar
      [project @ 2000-03-14 01:52:25 by sof] · 91a5556d
      sof authored
      Misc Win32 bitrot
      91a5556d
  4. 13 Mar, 2000 3 commits
  5. 10 Mar, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-03-10 15:23:40 by simonmar] · f9a0273c
      simonmar authored
      Fix h{Fill,Put}Buf(BA)?.  They now work in the presence of
      partial/blocking reads and writes, and hPutBuf now doesn't hold on to
      the handle while it's blocking.
      f9a0273c
    • simonmar's avatar
      [project @ 2000-03-10 15:20:18 by simonmar] · 2f4676b4
      simonmar authored
      Fix h{Fill,Put}Buf(BA)?.  They now work in the presence of
      partial/blocking reads and writes, and hPutBuf now doesn't hold on to
      the handle while it's blocking.
      2f4676b4
  6. 09 Mar, 2000 4 commits
    • andy's avatar
      [project @ 2000-03-09 21:16:49 by andy] · 237783e7
      andy authored
      Wibble: rm needless import Prelude used by Hugs.
      237783e7
    • panne's avatar
      [project @ 2000-03-09 13:33:01 by panne] · 8967a36a
      panne authored
      Changed an #ifdef so that the Prelude can be builit again by GHC.
      8967a36a
    • panne's avatar
      [project @ 2000-03-09 13:28:08 by panne] · 93522b22
      panne authored
      Removed a typo, i.e. ]\begin{code} => \begin{code}
      93522b22
    • andy's avatar
      [project @ 2000-03-09 06:14:38 by andy] · 7bc3ecec
      andy authored
      improving the synatax and semantics of the privileged import
      
       Typical use might be:
      
        import Prelude
        import privileged Prelude ( IORef , unsafePerformIO )
      
       Which means please ignore the export that comes with Prelude,
       and let me at compiler internal magic operations, IORef and
       unsafePerformIO (both are later exported by IOExt)
      
      I've also updated the stdlib files to use this (hugs only :-).
      7bc3ecec
  7. 06 Mar, 2000 1 commit
  8. 02 Mar, 2000 1 commit
  9. 29 Feb, 2000 2 commits
    • sewardj's avatar
      [project @ 2000-02-29 12:54:51 by sewardj] · 8b64c2c5
      sewardj authored
      Make foreign import work in combined mode:
      -- Allow interpreter to do ccall primops even in combined mode
      -- Implement hugsprimMkIO in combined mode, so as to wrap up a
         an IO value created by Hugs in a form compatible with GHC's IO
         representation.
      8b64c2c5
    • simonmar's avatar
      [project @ 2000-02-29 12:08:55 by simonmar] · cd9d822e
      simonmar authored
      Fix boundary cases for quotInteger, remInteger & a few others.  These
      changes somehow escaped 4.06 and have been sitting in my tree for a
      while.
      cd9d822e
  10. 25 Feb, 2000 1 commit
  11. 15 Feb, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-02-15 11:24:20 by sewardj] · f460a89b
      sewardj authored
      In hugsprimRunIO_toplevel, use catchException instead of catch.
      At least exceptions can then be caught, although Hugs then goes on
      to die with an assertion failure in unblockAsyncExceptionszh_ret_entry,
      probably caused by wrongly entering it twice in immediate succession.
      f460a89b
  12. 09 Feb, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-02-09 14:50:19 by sewardj] · 0198d561
      sewardj authored
      More bug fixes resulting from trying to load small programs into Hugs
      using the GHC Prelude:
      
      -- Better handling of kinds on class method types.  It's still a kludge
         (I reckon) but works well enough to correctly handle methods in
         Monad and Functor.  See comment in startGHCClass() in interface.c.
      
      -- Add hugsprimReadField and hugsprimShowField.
      
      -- Make error be exported from the Prelude.  For some reason, PrelErr.hi
         doesn't give a signature for error, so we have to fake it by copying
         that of hugsprimError.
      
      -- Handle fixity declarations read from interfaces.
      
      -- Set nameListMonad so that list comprehensions can be translated.
      0198d561
  13. 08 Feb, 2000 1 commit
  14. 03 Feb, 2000 1 commit
  15. 31 Jan, 2000 1 commit
  16. 30 Jan, 2000 3 commits
    • simonmar's avatar
      [project @ 2000-01-30 10:25:27 by simonmar] · ca2ab438
      simonmar authored
      Change the type of catch# to
      
      	catch# :: (W# -> (# W#, a #))
      	       -> (b -> W# -> (# W#, a #))
      	       -> W# -> (# W# , a #)
      
      where W# == State# RealWorld.  In other words, make it explicit that
      catch# is an IO operation and takes IO operations as arguments.  The
      previous type was too general, and resulted in catch# having the wrong
      arity which could cause mis-optimisations.
      
      The down side is that we now have to pass the state token around
      inside the primop instead of doing it in the Haskell wrapper, and
      raiseAsync() also has to build a PAP(handler,exception,realworld)
      instead of just a PAP(handler,exception) when it invokes a handler as
      a result of an async exception.
      
      I also added some optimisations to (un)?blockAsyncException to not
      grow the stack if it can be avoided, such as when we're about to block
      async exceptions and there's a blockAsyncExceptions_ret stack frame on
      the top of the stack.
      ca2ab438
    • simonmar's avatar
      [project @ 2000-01-30 10:11:32 by simonmar] · 84ccb85d
      simonmar authored
      Add notes about where the IO representation is wired in to various
      parts of the source tree, since I'm about to add some more.
      84ccb85d
    • simonmar's avatar
      [project @ 2000-01-30 10:08:27 by simonmar] · 3427092e
      simonmar authored
      comment fixup
      3427092e
  17. 25 Jan, 2000 1 commit
  18. 23 Jan, 2000 1 commit
    • andy's avatar
      [project @ 2000-01-23 09:55:17 by andy] · ee152a67
      andy authored
      GHC now uses the "Hugs" split function, which is believed to have
      better behaviour: it is not unsafe, is deterministic, and works
      better with QuickCheck, a major client.
      
      Rational for the Record, quoted from Mark Jones mail on the Hugs list:
      
      [Mark Jones]
      A couple of months ago, John Hughes sent me mail about a problem that
      he had uncovered with the implementation of the Random library in Hugs.
      He had been using the "split" function in an attempt to generate a
      stream of random number generators, each of which he hoped would be
      different from the others.  But instead he found that he actually
      ended with many different copies of the *same* random number generator.
      A disappointing, and frustratingly non-random result.
      
      If you don't happen to recall, split is a member of the RandomGen class,
      with type RandomGen g => g -> (g,g); it takes a single random number
      generator as its argument, and returns a pair of two new generators as
      its result.  The only thing that the specification requires is that the
      two generators returned are (a) distinct and (b) `independently robust'
      from a statistical point of view.  To the best of my knowledge, the
      implementation in Hugs meets this modest specification.  Sadly, assuming
      only this specification, you cannot write the function that John was
      looking for and be sure that it will generate more than two different
      generators.
      
      For example, the specification allows even the following trivial
      implementation for split:  split _ = (g1, g2), where g1 and g2 are some
      arbitrary but constant pair of distinct, and independently robust
      generators.  With this implementation, you can split as often as you
      want and you'll never get more that two generators.
      
      Hugs and GHC (as far as I can tell) both use definitions of the form:
      
         split g = (g, f g)
      
      for some function f.  (My understanding of the code in GHC is that it
      uses an unsafe function for f, breaking referential transparency; I hope
      the optimizer knows about this.)  Note that this definition returns the
      argument as a result; the specification doesn't prohibit that; all it
      requires is that the two results returned be distinct.  But if you try
      to generate a list of n different generators using:
      
         take n (iterate (fst . split) g)
      
      then you will be sorely disappointed; you might as well have written
      replicate n g.  (On the other hand, if you were lucky enough to have
      used (snd . split), instead of (fst . split), then you wouldn't have
      noticed the problem ...)
      
      I know very little about the mathematics or pragmatics of random
      number generators, so I'm not sure that I know how to fix this
      problem.  However, starting from this position of ignorance, I have
      hacked up a new version of "split" for the standard "StdGen" that
      will appear in the next release of Hugs (real soon now!).  Judging
      from the tests that I've tried so far, it seems to work much
      better than the old version.  That said:
      
       - Take care if you use Random.split in your programs, because it
         may not do what you expect.
      
       - There should probably be an errata about this for the Haskell 98
         library report ... if somebody can figure out what it should say.
      
       - If you use Hugs, be aware that the implementation of Random.split
         was hacked up by someone who has no way of justifying that
         implementation, beyond some simple experiments.
      
       - If you know something about the mechanics of random number
         generators, here's an area where Haskell specifications and
         implementations could benefit from your knowledge!
      
      All the best,
      Mark
      [end quote]
      ee152a67
  19. 19 Jan, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-01-19 17:06:25 by simonmar] · d6e5fc13
      simonmar authored
      The minInt saga continues:
      
       - fix several Integer division-type functions for the
         case when the dividend == S# (-2147483648#).
      
      Pointed out by: Marc Van Dongen <dongen@cs.ucc.ie>
      d6e5fc13
  20. 18 Jan, 2000 3 commits
  21. 17 Jan, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-01-17 12:30:07 by simonmar] · 455a2845
      simonmar authored
      Seeking didn't take into account the size of the current buffer
      (although it seems the intention was there: the proper offset was
      calculated, just never used).
      
      This fixes the io013 failure.
      455a2845
  22. 14 Jan, 2000 1 commit
  23. 13 Jan, 2000 1 commit
    • hwloidl's avatar
      [project @ 2000-01-13 14:33:57 by hwloidl] · 1b28d4e1
      hwloidl authored
      Merged GUM-4-04 branch into the main trunk. In particular merged GUM and
      SMP code. Most of the GranSim code in GUM-4-04 still has to be carried over.
      1b28d4e1
  24. 12 Jan, 2000 1 commit
  25. 11 Jan, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-01-11 10:15:24 by sewardj] · 138b4bc7
      sewardj authored
      A module for use with the combined GHC-Hugs system.  Contains various
      small helper functions referred to which Hugs' desugarer emits references.
      The same functions are implemented in ghc/interpreter/lib/Prelude.hs
      for use in standalone Hugs.  The two versions should correspond exactly.
      138b4bc7
  26. 04 Jan, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-01-04 17:40:46 by simonpj] · 5ca77490
      simonpj authored
      This commit arranges that literal strings will fuse
      nicely, by expressing them as an application of build.
      
      * NoRepStr is now completely redundant, though I havn't removed it yet.
      
      * The unpackStr stuff moves from PrelPack to PrelBase.
      
      * There's a new form of Rule, a BuiltinRule, for rules that
        can't be expressed in Haskell.  The string-fusion rule is one
        such.  It's defined in prelude/PrelRules.lhs.
      
      * PrelRules.lhs also contains a great deal of code that
        implements constant folding.  In due course this will replace
        ConFold.lhs, but for the moment it simply duplicates it.
      5ca77490
  27. 20 Dec, 1999 1 commit