| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch over to the new hierarchical libraries
---------------------------------------------
This commit reorganises our libraries to use the new hierarchical
module namespace extension.
The basic story is this:
- fptools/libraries contains the new hierarchical libraries.
Everything in here is "clean", i.e. most deprecated stuff has
been removed.
- fptools/libraries/base is the new base package
(replacing "std") and contains roughly what was previously
in std, lang, and concurrent, minus deprecated stuff.
Things that are *not allowed* in libraries/base include:
Addr, ForeignObj, ByteArray, MutableByteArray,
_casm_, _ccall_, ``'', PrimIO
For ByteArrays and MutableByteArrays we use UArray and
STUArray/IOUArray respectively now.
Modules previously called PrelFoo are now under
fptools/libraries/GHC. eg. PrelBase is now GHC.Base.
- fptools/libraries/haskell98 provides the Haskell 98 std.
libraries (Char, IO, Numeric etc.) as a package. This
package is enabled by default.
- fptools/libraries/network is a rearranged version of
the existing net package (the old package net is still
available; see below).
- Other packages will migrate to fptools/libraries in
due course.
NB. you need to checkout fptools/libraries as well as
fptools/hslibs now. The nightly build scripts will need to be
tweaked.
- fptools/hslibs still contains (almost) the same stuff as before.
Where libraries have moved into the new hierarchy, the hslibs
version contains a "stub" that just re-exports the new version.
The idea is that code will gradually migrate from fptools/hslibs
into fptools/libraries as it gets cleaned up, and in a version or
two we can remove the old packages altogether.
- I've taken the opportunity to make some changes to the build
system, ripping out the old hslibs Makefile stuff from
mk/target.mk; the new package building Makefile code is in
mk/package.mk (auto-included from mk/target.mk).
The main improvement is that packages now register themselves at
make boot time using ghc-pkg, and the monolithic package.conf
in ghc/driver is gone.
I've updated the standard packages but haven't tested win32,
graphics, xlib, object-io, or OpenGL yet. The Makefiles in
these packages may need some further tweaks, and they'll need
pkg.conf.in files added.
- Unfortunately all this rearrangement meant I had to bump the
interface-file version and create a bunch of .hi-boot-6 files :-(
|
|
|
|
| |
Fix hSetPosn type in the export comment.
|
|
|
|
|
|
|
|
| |
Try to improve matters in the text-mode-seek swamp. Only disallow
text-mode-seeks on Win32, rather than on all platforms. That means
that seeks in text mode on Unix platforms should work as originally
(which was the correct H98 behaviour), whilst Win32 generates
exceptions if you do seeks in text mode.
|
|
|
|
|
|
|
|
|
|
|
| |
More fixups to make the new IO lib work on mingw.
* Outlaw changing the file position on a text-mode file. After
consideration of the mingw translation semantics I cannot see
how to make a correct implementation.
* Add a field to Handle__ to say whether or not the handle is in
binary mode.
* Restrict seek operations on Handles to those in binary mode.
* Export hSetBinaryMode from IO.lhs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I/O library rewrite
-------------------
This commit replaces the old C/Haskell I/O implementation with a new
Haskell-only one using the new FFI & hsc2hs.
main points:
- lots of code deleted: we're about 3000 lines of C lighter,
but the amount of Haskell code is about the same.
- performance is ok: some operations are faster, others are
slower. There's still some tuning to do, though.
- the new library is designed to handle read/write streams
much better: a read/write stream gets a special kind of
handle internally called a "DuplexHandle", which actually
contains two separate handles, one for writing and one for
reading. The upshot is that you can do simultaneous reading
and writing to/from a socket or FIFO without any locking
problems. The effect is similar to calling socketToHandle
twice, except that finalization works properly (creating
two separate Handles could lead to the socket being closed
too early when one of the Handles is GC'd).
- hConnectTo and withHandleFor are gone (no one responded to
my mail on GHC users, but we can always bring 'em back if
necessary).
- I made a half-hearted attempt at keeping the system-specific
code in one place: see PrelPosix.hsc.
- I've rearranged the I/O tests and added lots more.
ghc/tests/lib/IO now contains Haskell 98-only IO tests,
ghc/test/lib/{IOExts, Directory, Time} now contain tests for
the relevant libraries. I haven't quite finished in here yet,
the IO tests work but the others don't yet.
- I haven't done anything about Unicode yet, but now we can
start to discuss what needs doing here. The new library
is using MutableByteArrays for its buffers because that
turned out to be a *lot* easier (and quicker) than malloc'd
buffers - I hope this won't cause trouble for unicode
translations though.
WARNING: Windows users refrain from updating until we've had a chance
to fix any issues that arise.
Testing: the basic H98 stuff has been pretty thoroughly tested, but
the new duplex handle stuff is still a little green.
|
|
|
|
|
|
| |
- fix copyrights
- remove some unused imports
- comment formatting fixes
|
|
|
|
|
|
|
|
|
| |
Complete the previous commit. I think things should
be OK now; but the Hugs versioning may well need
adjusting.
NOTE: I've added PrelIO.lhs; it contains all the GHC parts
of what was IO.lhs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make it so that
(A) All modules imported by Prelude are PrelXXX modules,
not library modules (notably Ix, Monad were culprits).
This lines up with the Hugs story, and is more intuitive.
(B) All things needed implicitly by syntax (e.g. do-notation
needs Monad) come from PrelXXX modules, even if they aren't
visible when you say 'import Prelude'.
These changes simplify the story, and fix the 'looking for [boot]
interface for Ix' problem.
This change is not quite complete. I'm committing it so
Simon can finish it off.
|
|
|
|
| |
Changing PrimPrel to PrelPrim
|
|
|
|
| |
Using the new Prelude structure to handle prims.
|
|
|
|
| |
Wibble One.
|
|
|
|
| |
don't export non-std stuff.
|
|
|
|
| |
Wibble: rm needless import Prelude used by Hugs.
|
|
|
|
| |
Removed a typo, i.e. ]\begin{code} => \begin{code}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 :-).
|
|
|
|
| |
Removing debugging printf code from hClose.
|
|
|
|
|
|
| |
Don't hold the lock on the Handle while we block waiting for data on a
read. This is a partial solution to the general problem of holding a
lock on the Handle while in mayBlock.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixing incorrect definition of BlockBuffering in Hugs.
|
|
|
|
| |
Enforce multiple reader, single writer semantics for Handles.
|
|
|
|
|
|
| |
Reduce the number of orphan-instance modules. There are a few left,
but these can't be removed without significant reorganisation due to
recursive dependencies.
|
|
|
|
| |
remove some irrelevant code
|
|
|
|
|
|
| |
Implement more of IO std library. Buffering settings,
seekery and some error-handling stuff is still missing, but the
rest is done.
|
|
|
|
|
| |
Changing to use the new IO primitives.
Addr is no longer a synonym of Int.
|
|
|
|
|
|
|
| |
Adding in the modified versions of the Standard Haskell 98 libraries.
These should compile under both Hugs and GHC.
use the flags -D__HUGS__ -DUSE_REPORT_PRELUDE to extract the Hugs src.
|
|
|
|
|
| |
Drop the use of _ccall_, _casm_ and lit-lits in std/, "foreign import" is
the future.
|
|
|
|
|
|
| |
Revert commit of 1999/06/12 16:17:28. We use -traditional for CPP,
and so x##y and #x don't work and we must use x/**/y (ugh) and "x"
(urk!!) instead. Ah well.
|
|
|
|
| |
Fix some race holes in the handle locking code, and clean it up a little.
|
|
|
|
| |
K&R -> ANSI token pasting (ie, x##y for x/**/y)
|
|
|
|
| |
Remove illegal use of layout.
|
|
|
|
| |
../compiler/msg_prel
|
|
|
|
|
|
| |
The implementation of hGetLine, as given in the report, doesn't handle
partial lines on unbuffered handles that well (not at all, as it turns
out). Fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Re-integrated mod. that seems to have been dropped on the
floor when new-rts moved back onto the main trunk. Here's
the commit msg. that was originally used:
Extend hConnectTo to also allow output handles to be connected, i.e.,
h1 <- openFile "foo" WriteMode
h2 <- openFile "bar" WriteMode
hConnectTo h1 h2
will cause h1's buffer to be flushed when h2's buffer overflows
(and it is just about to be flushed.) The implementation is currently
not as lazy as that, it flushes h1's buffer regardless of whether a
write to h2 causes h2's buffer to overflow or not.
This is used to connect 'stderr' and 'stdout', i.e., output on
'stderr' will now cause 'stdout' output to (first) be flushed.
|
|
|
|
|
|
|
| |
Changes to make the Prelude comply with Haskell 98.
I claim that this completes GHC's implementation of Haskell 98 (at
least feature-wise, but there's bound to be some bugs lurking..)
|
|
|
|
| |
Move 4.01 onto the main trunk.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend hConnectTo to also allow output handles to be connected, i.e.,
h1 <- openFile "foo" WriteMode
h2 <- openFile "bar" WriteMode
hConnectTo h1 h2
will cause h1's buffer to be flushed when h2's buffer overflows
(and it is just about to be flushed.) The implementation is currently
not as lazy as that, it flushes h1's buffer regardless of whether h2's
buffer overflows or not.
This is used to connect 'stderr' and 'stdout', i.e., output on
'stderr' will now cause 'stdout' output to (first) be flushed.
|
|
|
|
| |
Fixed endian bug that struck when outputting on non-buffered handles
|
|
|
|
|
|
| |
[non-standard]:
Have IO also export the standard IO functions that only
the Prelude (in 1.4) provides.
|
|
|
|
| |
Completely rewritten IO implementation
|
|
|
|
| |
IO.hInputReady: interval arg is millisecs, not secs
|
|
|
|
| |
Wrong t. signature for ioeGetErrorString
|
|
|
|
|
| |
Use BUFSIZ sized blocks for Haskell-side buffering, not (BUFSIZ+1),
which probably interacts very badly with the C-side buffering.
|
|
|
|
|
|
| |
- Add NOINLINE pragmas to the unsafe things (unsafe*IO, unsafe*ST, runST etc.)
- Move unsafe function back into the proper modules
- Remove PrelUnsafe*.lhs
|
|
|
|
| |
Misc code cleanup
|
|
Library re-organisation:
All libraries now live under ghc/lib, which has the following structure:
ghc/lib/std -- all prelude files (libHS.a)
ghc/lib/std/cbits
ghc/lib/exts -- standard Hugs/GHC extensions (libHSexts.a)
-- available with '-fglasgow-exts'
ghc/lib/posix -- POSIX library (libHSposix.a)
ghc/lib/posix/cbits -- available with '-syslib posix'
ghc/lib/misc -- used to be hslibs/ghc (libHSmisc.a)
ghc/lib/misc/cbits -- available with '-syslib misc'
ghc/lib/concurrent -- Concurrent libraries (libHSconc.a)
-- available with '-concurrent'
Also, several non-standard prelude modules had their names changed to begin
with 'Prel' to reduce namespace pollution.
Addr ==> PrelAddr (Addr interface available in 'exts')
ArrBase ==> PrelArr
CCall ==> PrelCCall (CCall interface available in 'exts')
ConcBase ==> PrelConc
GHCerr ==> PrelErr
Foreign ==> PrelForeign (Foreign interface available in 'exts')
GHC ==> PrelGHC
IOHandle ==> PrelHandle
IOBase ==> PrelIOBase
GHCmain ==> PrelMain
STBase ==> PrelST
Unsafe ==> PrelUnsafe
UnsafeST ==> PrelUnsafeST
|