1. 08 Feb, 2000 1 commit
  2. 03 Feb, 2000 1 commit
  3. 31 Jan, 2000 1 commit
  4. 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
  5. 25 Jan, 2000 1 commit
  6. 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
  7. 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
  8. 18 Jan, 2000 3 commits
  9. 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
  10. 14 Jan, 2000 1 commit
  11. 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
  12. 12 Jan, 2000 1 commit
  13. 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
  14. 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
  15. 20 Dec, 1999 2 commits
    • simonpj's avatar
      [project @ 1999-12-20 10:35:47 by simonpj] · 34a4921d
      simonpj authored
      Forgot to remove PrelNumExtra in the last commit
      34a4921d
    • simonpj's avatar
      [project @ 1999-12-20 10:34:27 by simonpj] · e921b2e3
      simonpj authored
      This commit implements a substantial re-organisation of the Prelude
      It also fixes a couple of small renamer bugs that were reported recently
      	(notably, Sven pointed out that we weren't reporting
      	unused imports properly)
      
      My original goal was to get rid of all "orphan" modules (i.e. ones
      with instance decls that don't belong either to a tycon or a class
      defined in the same module).  This should reduce the number of
      interface files that have to be read when compiling small Haskell
      modules.
      
      But like most expeditions into the Prelude Swamp, it spiraled out
      of control.  The result is quite satisfactory, though.
      
      	GONE AWAY:	PrelCCall, PrelNumExtra
      
      	NEW:		PrelReal, PrelFloat, PrelByteArr, PrelNum.hi-boot
      
      (The extra PrelNum.hi-boot is because of a tiresome thin-air Id, addr2Integer,
      which used to be in PrelBase.)
      
      Quite a lot of types have moved from one module to another,
      which entails some changes to part of the compiler (PrelInfo, PrelMods) etc,
      and there are a few places in the RTS includes and even in the driver
      that know about these home modules (alas).
      
      So the rough structure is as follows, in (linearised) dependency order
      	[this list now appears in PrelBase.lhs]
      
      PrelGHC		Has no implementation.  It defines built-in things, and
      		by importing it you bring them into scope.
      		The source file is PrelGHC.hi-boot, which is just
      		copied to make PrelGHC.hi
      
      		Classes: CCallable, CReturnable
      
      PrelBase	Classes: Eq, Ord, Functor, Monad
      		Types:   list, (), Int, Bool, Ordering, Char, String
      
      PrelTup		Types: tuples, plus instances for PrelBase classes
      
      PrelShow	Class: Show, plus instances for PrelBase/PrelTup types
      
      PrelEnum	Class: Enum,  plus instances for PrelBase/PrelTup types
      
      PrelMaybe	Type: Maybe, plus instances for PrelBase classes
      
      PrelNum		Class: Num, plus instances for Int
      		Type:  Integer, plus instances for all classes so far (Eq, Ord, Num, Show)
      
      		Integer is needed here because it is mentioned in the signature
      		of 'fromInteger' in class Num
      
      PrelReal	Classes: Real, Integral, Fractional, RealFrac
      			 plus instances for Int, Integer
      		Types:  Ratio, Rational
      			plus intances for classes so far
      
      		Rational is needed here because it is mentioned in the signature
      		of 'toRational' in class Real
      
      Ix		Classes: Ix, plus instances for Int, Bool, Char, Integer, Ordering, tuples
      
      PrelArr		Types: Array, MutableArray, MutableVar
      
      		Does *not* contain any ByteArray stuff (see PrelByteArr)
      		Arrays are used by a function in PrelFloat
      
      PrelFloat	Classes: Floating, RealFloat
      		Types:   Float, Double, plus instances of all classes so far
      
      		This module contains everything to do with floating point.
      		It is a big module (900 lines)
      		With a bit of luck, many modules can be compiled without ever reading PrelFloat.hi
      
      PrelByteArr	Types: ByteArray, MutableByteArray
      
      		We want this one to be after PrelFloat, because it defines arrays
      		of unboxed floats.
      
      
      Other Prelude modules are much easier with fewer complex dependencies.
      e921b2e3
  16. 14 Dec, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-12-14 14:26:14 by simonmar] · 406aa1d7
      simonmar authored
      Don't set O_NONBLOCK on stdout and stderr.  This is a workaround for a
      combination of bizarre Unix semantics and shells which don't reset the
      nonblocking flag after running a program.
      406aa1d7
  17. 13 Dec, 1999 1 commit
  18. 09 Dec, 1999 1 commit
  19. 08 Dec, 1999 4 commits
    • simonmar's avatar
      [project @ 1999-12-08 15:47:06 by simonmar] · 4ee0f622
      simonmar authored
      misc ansification and -Wall cleanup
      4ee0f622
    • simonmar's avatar
      [project @ 1999-12-08 14:21:52 by simonmar] · 9c370d69
      simonmar authored
      Add Marc Van Dongen's Integer improvements.  Specifically:
      
      	- new primops: gcdInt#, gcdIntegerInt#, divExact#,
      	  quotInteger#, remInteger#.
      
      	- new definitions of quot and rem for Integer in
      	  PrelNum (using the new quotInteger# and remInteger#
      	  primops instead of quotRemInteger#).  Should be
      	  slightly faster than before.  div & mod aren't
      	  likewise optimised (yet).
      
      	- specialisations of gcd for Int and Integer, and
      	  lcm for Integer in PrelNum.
      9c370d69
    • simonmar's avatar
      [project @ 1999-12-08 14:04:32 by simonmar] · 14a15152
      simonmar authored
      oops, forgot to initialize bufStart in openStdFile.
      14a15152
    • simonmar's avatar
      [project @ 1999-12-08 10:10:59 by simonmar] · 9c569d63
      simonmar authored
      New make variable: $(WithNofibHc) which defines the Haskell compiler
      used to build nofib.
      
      Define $(GHC_INPLACE) in fptools/mk/config.mk.in.  $(WithNofibHc) is
      set to $(GHC_INPLACE) by default.
      
      Fix $(MKDEPENDHS) in ghc/lib/std/Makefile.
      9c569d63
  20. 07 Dec, 1999 1 commit
  21. 04 Dec, 1999 2 commits
  22. 03 Dec, 1999 1 commit
  23. 01 Dec, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-12-01 14:34:38 by simonmar] · e1dc924b
      simonmar authored
      Support for blocking & unblocking asynchronous exceptions.
      
        - new primops:
      
      	blockAsyncExceptions#, unblockAsyncExceptions# :: IO a -> IO a
      
        - raiseInThread will block if the target thread is currently
          blocking async exceptions.
      
        - async exceptions are currently implicitly blocked inside
          an exception handler.  This decision might be reversed when
          we have more experience with this stuff.
      
        - Move exception-related stuff in the RTS into its own file,
          Exception.{h,hc}.
      e1dc924b
  24. 29 Nov, 1999 1 commit
  25. 26 Nov, 1999 3 commits
  26. 25 Nov, 1999 3 commits
  27. 24 Nov, 1999 1 commit