- 08 Feb, 2000 1 commit
-
-
sewardj authored
Add hugsprimError, hugsprimCompAux.
-
- 03 Feb, 2000 1 commit
-
-
sewardj authored
Add hugsprimPmFail.
-
- 31 Jan, 2000 1 commit
-
-
simonmar authored
We don't want -keep-{hc,s}-files-too on by default, and why do we need -H32M -K32M for PrelBase.lhs? Hans: I want a word with you :)
-
- 30 Jan, 2000 3 commits
-
-
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.
-
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.
-
simonmar authored
comment fixup
-
- 25 Jan, 2000 1 commit
-
-
panne authored
Added intToWord to PrelAddr. Use it instead of int2Word#-hacks.
-
- 23 Jan, 2000 1 commit
-
-
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]
-
- 19 Jan, 2000 1 commit
-
-
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>
-
- 18 Jan, 2000 3 commits
- 17 Jan, 2000 1 commit
-
-
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.
-
- 14 Jan, 2000 1 commit
-
-
simonmar authored
expose 'par' now that we have an implementation for both sequential and SMP ways.
-
- 13 Jan, 2000 1 commit
-
-
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.
-
- 12 Jan, 2000 1 commit
-
-
sewardj authored
Make hugsprimUnpackString :: Addr -> String available to Hugs' desugarer in both modes.
-
- 11 Jan, 2000 1 commit
-
-
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.
-
- 04 Jan, 2000 1 commit
-
-
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.
-
- 20 Dec, 1999 2 commits
-
-
simonpj authored
Forgot to remove PrelNumExtra in the last commit
-
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.
-
- 14 Dec, 1999 1 commit
-
-
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.
-
- 13 Dec, 1999 1 commit
-
-
simonmar authored
Fix bug in abs::Integer->Integer: result was wrong for minBound::Int.
-
- 09 Dec, 1999 1 commit
-
-
simonmar authored
clean PrelGHC.hi in its various flavours. Obtained-from: Michael Weber <michael.weber@post.rwth-aachen.de>
-
- 08 Dec, 1999 4 commits
-
-
simonmar authored
misc ansification and -Wall cleanup
-
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.
-
simonmar authored
oops, forgot to initialize bufStart in openStdFile.
-
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.
-
- 07 Dec, 1999 1 commit
-
-
simonmar authored
Now that $(GHC) means an installed copy of ghc, use $(GHC_INPLACE) to refer to the ghc in the build tree.
-
- 04 Dec, 1999 2 commits
- 03 Dec, 1999 1 commit
-
-
simonmar authored
Move fixST and fixIO out of the prelude.
-
- 01 Dec, 1999 1 commit
-
-
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}.
-
- 29 Nov, 1999 1 commit
-
-
keithw authored
error.h -> stgerror.h
-
- 26 Nov, 1999 3 commits
- 25 Nov, 1999 3 commits
-
-
simonmar authored
Incremental cleanups & improvements to the I/O subsystem - Initial fix for problems caused by partial writes to non-blocking file descriptors. To see this bug, run ghc/tests/programs/life_space_leak through a pipe. - remove FILEOBJ_FLUSH, it allegedly has the same meaning as FILEOBJ_WRITE. This fixes a buf in openFd: it erroneously didn't set FILEOBJ_FLUSH on writeable file descriptors. - some ANSIfication
-
simonpj authored
Add a comment
-
simonpj authored
Express sequence in terms of foldr
-
- 24 Nov, 1999 1 commit
-
-
simonmar authored
wibble
-