packages/old-time.git
16 years ago[project @ 2003-04-01 16:30:37 by simonpj]
simonpj [Tue, 1 Apr 2003 16:30:37 +0000 (16:30 +0000)] 
[project @ 2003-04-01 16:30:37 by simonpj]
Use INLINE rather than SPECIALISE for ceiling, floor, truncate

16 years ago[project @ 2003-03-31 15:36:24 by ross]
ross [Mon, 31 Mar 2003 15:36:24 +0000 (15:36 +0000)] 
[project @ 2003-03-31 15:36:24 by ross]
remove a GHC-ism

16 years ago[project @ 2003-03-31 13:58:43 by simonmar]
simonmar [Mon, 31 Mar 2003 13:58:43 +0000 (13:58 +0000)] 
[project @ 2003-03-31 13:58:43 by simonmar]
Get the filename right in IOErrors generated by several functions in
here.

16 years ago[project @ 2003-03-31 13:58:03 by simonmar]
simonmar [Mon, 31 Mar 2003 13:58:03 +0000 (13:58 +0000)] 
[project @ 2003-03-31 13:58:03 by simonmar]
- Add ioeSet{ErrorType,ErrorString,Handle,FileName} to match the
  existing ioeGet* functions.

- Add modifyIOError :: (IOError -> IOError) -> IO a -> IO a

16 years ago[project @ 2003-03-30 12:20:16 by ross]
ross [Sun, 30 Mar 2003 12:20:17 +0000 (12:20 +0000)] 
[project @ 2003-03-30 12:20:16 by ross]
withForeignPtr is portable.  So is some other stuff, though only Hugs
uses the portable versions at present.

16 years ago[project @ 2003-03-27 10:24:43 by simonmar]
simonmar [Thu, 27 Mar 2003 10:24:43 +0000 (10:24 +0000)] 
[project @ 2003-03-27 10:24:43 by simonmar]
[ oops, forgot to commit this with the rest of the changes yesterday... ]

Change our ForeignPtr implementation to match the spec: finalizers
must now be foreign functions.

Move the old Haskell-finalizer versions of newForeignPtr and
addForeignPtrFinalizer into Foreign.Concurrent, to make it clear that
the implementations of these functions require concurrency.

While I'm here: move the GHC-specific parts of the ForeignPtr
implementation into GHC.ForeignPtr.

16 years ago[project @ 2003-03-26 15:25:46 by simonmar]
simonmar [Wed, 26 Mar 2003 15:25:46 +0000 (15:25 +0000)] 
[project @ 2003-03-26 15:25:46 by simonmar]
Change our ForeignPtr implementation to match the spec: finalizers
must now be foreign functions.

Move the old Haskell-finalizer versions of newForeignPtr and
addForeignPtrFinalizer into Foreign.Concurrent, to make it clear that
the implementations of these functions require concurrency.

While I'm here: move the GHC-specific parts of the ForeignPtr
implementation into GHC.ForeignPtr.

16 years ago[project @ 2003-03-26 12:35:34 by simonmar]
simonmar [Wed, 26 Mar 2003 12:35:34 +0000 (12:35 +0000)] 
[project @ 2003-03-26 12:35:34 by simonmar]
Add getrlimit()/setrlimit() suppport

16 years ago[project @ 2003-03-14 13:08:04 by simonmar]
simonmar [Fri, 14 Mar 2003 13:08:04 +0000 (13:08 +0000)] 
[project @ 2003-03-14 13:08:04 by simonmar]
Attach the finalizer to the write side of a duplex handle, where it
should have been.  Otherwise finalization of duplex handles doesn't
work properly.

MERGE TO STABLE

16 years ago[project @ 2003-03-12 16:42:27 by ijones]
ijones [Wed, 12 Mar 2003 16:42:27 +0000 (16:42 +0000)] 
[project @ 2003-03-12 16:42:27 by ijones]
* Added more Haddock documentation to functions / classes / types
* Added section headings for classes / types
* Added an Examples section

16 years ago[project @ 2003-03-11 18:41:43 by panne]
panne [Tue, 11 Mar 2003 18:41:43 +0000 (18:41 +0000)] 
[project @ 2003-03-11 18:41:43 by panne]
Fixed link to getArgs

16 years ago[project @ 2003-03-09 20:19:27 by panne]
panne [Sun, 9 Mar 2003 20:19:27 +0000 (20:19 +0000)] 
[project @ 2003-03-09 20:19:27 by panne]
Fixed markup confusion ("" vs. '')

16 years ago[project @ 2003-03-08 23:03:47 by panne]
panne [Sat, 8 Mar 2003 23:03:49 +0000 (23:03 +0000)] 
[project @ 2003-03-08 23:03:47 by panne]
More markup fixes...

16 years ago[project @ 2003-03-08 19:02:39 by panne]
panne [Sat, 8 Mar 2003 19:02:39 +0000 (19:02 +0000)] 
[project @ 2003-03-08 19:02:39 by panne]
Fixed some broken/redirected/canonicalized links found by a very picky
link checker.

16 years ago[project @ 2003-03-06 09:51:03 by simonmar]
simonmar [Thu, 6 Mar 2003 09:51:03 +0000 (09:51 +0000)] 
[project @ 2003-03-06 09:51:03 by simonmar]
Add Data/Array/IO to list of directories

16 years ago[project @ 2003-03-05 15:54:59 by malcolm]
malcolm [Wed, 5 Mar 2003 15:54:59 +0000 (15:54 +0000)] 
[project @ 2003-03-05 15:54:59 by malcolm]
For nhc98, use nullPtr rather than 0 as the argument to time().

16 years ago[project @ 2003-03-05 15:53:10 by malcolm]
malcolm [Wed, 5 Mar 2003 15:53:10 +0000 (15:53 +0000)] 
[project @ 2003-03-05 15:53:10 by malcolm]
Build the hierarchical libraries from .hc files when building nhc98 from .hc's.

16 years ago[project @ 2003-03-04 13:36:39 by ross]
ross [Tue, 4 Mar 2003 13:36:39 +0000 (13:36 +0000)] 
[project @ 2003-03-04 13:36:39 by ross]
add an #ifdef __GLASGOW_HASKELL__

16 years ago[project @ 2003-03-04 11:09:15 by simonmar]
simonmar [Tue, 4 Mar 2003 11:09:15 +0000 (11:09 +0000)] 
[project @ 2003-03-04 11:09:15 by simonmar]
Split Data.Array.IO into Data.Array.IO.Internals (which defines and
exports the concrete representations of IOArray and IOUArray) and
Data.Array.IO which exports the user-visible API.

This is necessary so that we can build more libraries that use
the internals of IOUArray in particular.

16 years ago[project @ 2003-02-28 12:34:43 by stolz]
stolz [Fri, 28 Feb 2003 12:34:43 +0000 (12:34 +0000)] 
[project @ 2003-02-28 12:34:43 by stolz]
- Rename System.Posix.Process.forkProcess to forkProcessAll
- Move GHC.Conc.forkProcess to System.Posix with type 'Maybe ProcessID'

Prompted by: George Russel

16 years ago[project @ 2003-02-26 10:22:14 by simonmar]
simonmar [Wed, 26 Feb 2003 10:22:14 +0000 (10:22 +0000)] 
[project @ 2003-02-26 10:22:14 by simonmar]
Add a note about the problem with forkProcess, for the time being.

16 years ago[project @ 2003-02-21 05:34:12 by sof]
sof [Fri, 21 Feb 2003 05:34:13 +0000 (05:34 +0000)] 
[project @ 2003-02-21 05:34:12 by sof]
Asynchronous / non-blocking I/O for Win32 platforms.

This commit introduces a Concurrent Haskell friendly view of I/O on
Win32 platforms. Through the use of a pool of worker Win32 threads, CH
threads may issue asynchronous I/O requests without blocking the
progress of other CH threads. The issuing CH thread is blocked until
the request has been serviced though.

GHC.Conc exports the primops that take care of issuing the
asynchronous I/O requests, which the IO implementation now takes
advantage of. By default, all Handles are non-blocking/asynchronous,
but should performance become an issue, having a per-Handle flag for
turning off non-blocking could easily be imagined&introduced.

[Incidentally, this thread pool-based implementation could easily be
extended to also allow Haskell code to delegate the execution of
arbitrary pieces of (potentially blocking) external code to another OS
thread. Given how relatively gnarly the locking story has turned out
to be with the 'threaded' RTS, that may not be such a bad idea.]

16 years ago[project @ 2003-02-20 09:36:40 by malcolm]
malcolm [Thu, 20 Feb 2003 09:36:40 +0000 (09:36 +0000)] 
[project @ 2003-02-20 09:36:40 by malcolm]
Add Foreign.Marshal.Pool to the nhc98 build.

16 years ago[project @ 2003-02-19 13:54:19 by malcolm]
malcolm [Wed, 19 Feb 2003 13:54:19 +0000 (13:54 +0000)] 
[project @ 2003-02-19 13:54:19 by malcolm]
Oops, the "directory-collecting" modules Foreign and Foreign.Marshal were
accidentally omitted from the nhc98 build.

16 years ago[project @ 2003-02-18 20:39:56 by panne]
panne [Tue, 18 Feb 2003 20:39:56 +0000 (20:39 +0000)] 
[project @ 2003-02-18 20:39:56 by panne]
Guerrilla tactics: Re-export Foreign.Marshal.Pool  >:-)

16 years ago[project @ 2003-02-18 20:15:15 by panne]
panne [Tue, 18 Feb 2003 20:15:15 +0000 (20:15 +0000)] 
[project @ 2003-02-18 20:15:15 by panne]
* Fixed bug #687034 (GetOpt overly ambiguous)
* Reformatted comment
* Synch example with reality

16 years ago[project @ 2003-02-17 15:13:56 by simonpj]
simonpj [Mon, 17 Feb 2003 15:13:56 +0000 (15:13 +0000)] 
[project @ 2003-02-17 15:13:56 by simonpj]
Wibbles to ST Monad methods; I forget why

16 years ago[project @ 2003-02-17 15:13:09 by simonpj]
simonpj [Mon, 17 Feb 2003 15:13:09 +0000 (15:13 +0000)] 
[project @ 2003-02-17 15:13:09 by simonpj]
Type sig for getTag

16 years ago[project @ 2003-02-17 11:43:21 by simonmar]
simonmar [Mon, 17 Feb 2003 11:43:21 +0000 (11:43 +0000)] 
[project @ 2003-02-17 11:43:21 by simonmar]
Comment wibble

16 years ago[project @ 2003-02-14 17:11:59 by sof]
sof [Fri, 14 Feb 2003 17:12:00 +0000 (17:12 +0000)] 
[project @ 2003-02-14 17:11:59 by sof]
- add missing config.h include to Handle.hs
- Handle.hSetBuffering: don't bother putting the handle's FD into
  'raw' mode under Win32. 'raw' mode is just too specialised and
  potentially confusing (see comments.)

16 years ago[project @ 2003-02-14 13:01:32 by simonpj]
simonpj [Fri, 14 Feb 2003 13:01:32 +0000 (13:01 +0000)] 
[project @ 2003-02-14 13:01:32 by simonpj]
Fix for deriving of records with leading underscore, and corresponding lex

16 years ago[project @ 2003-02-06 10:41:13 by simonmar]
simonmar [Thu, 6 Feb 2003 10:41:13 +0000 (10:41 +0000)] 
[project @ 2003-02-06 10:41:13 by simonmar]
Aargh!  We were setting the VMIN and VTIME values in the termios
structure when the terminal is in non-raw mode, rather than raw mode,
because I had a test round the wrong way.

Apparently on Linux VMIN and VTIME default to 1/0, so it apparently
worked properly, but on Solaris the VMIN slot in the c_cc array is
shared with the VEOF slot, which meant that VMIN was being left as 4
(the value of ^D, which is the default contents of VEOF).

Thanks to Hal Daume for reporting the bug, and Malcolm Wallce &
Lennart Augustsson for helping to point me in the right direction.

MERGE TO STABLE

16 years ago[project @ 2003-02-06 10:41:10 by ross]
ross [Thu, 6 Feb 2003 10:41:10 +0000 (10:41 +0000)] 
[project @ 2003-02-06 10:41:10 by ross]
Hugs-only: special definitions of fromInt & fromDouble.

16 years ago[project @ 2003-02-04 11:55:54 by simonmar]
simonmar [Tue, 4 Feb 2003 11:55:54 +0000 (11:55 +0000)] 
[project @ 2003-02-04 11:55:54 by simonmar]
Add support for using vfork, which I apparently removed when this file
was moved over from ghc/lib/std/cbits.  Using vfork on Linux makes
quite a big difference - eg. when building GHC.Base with -split-objs ,
I saw a 2.5s reduction in system time.

16 years ago[project @ 2003-01-30 20:41:10 by panne]
panne [Thu, 30 Jan 2003 20:41:10 +0000 (20:41 +0000)] 
[project @ 2003-01-30 20:41:10 by panne]
* Fixed the comment breakage of the previous commit (Haddock failure)
* Synched signature comments in header with reality
* Added default implementation of 'rotate' in terms of 'rotateL'/'rotateR'
* Removed spurios "signed": What's a signed rotate or a signed left shift??

16 years ago[project @ 2003-01-30 12:51:05 by ross]
ross [Thu, 30 Jan 2003 12:51:05 +0000 (12:51 +0000)] 
[project @ 2003-01-30 12:51:05 by ross]
fix for non-GHC

16 years ago[project @ 2003-01-29 14:28:47 by ross]
ross [Wed, 29 Jan 2003 14:28:47 +0000 (14:28 +0000)] 
[project @ 2003-01-29 14:28:47 by ross]
fix typo that broke non-GHC impls.

16 years ago[project @ 2003-01-29 07:54:46 by panne]
panne [Wed, 29 Jan 2003 07:54:46 +0000 (07:54 +0000)] 
[project @ 2003-01-29 07:54:46 by panne]
Ooops, unbreak non-GHC targets...

16 years ago[project @ 2003-01-28 21:48:23 by panne]
panne [Tue, 28 Jan 2003 21:48:23 +0000 (21:48 +0000)] 
[project @ 2003-01-28 21:48:23 by panne]
As agreed (= no riots after the proposal :-) on the FFI list,
introduce a re-exporting module Foreign.Marshal

16 years ago[project @ 2003-01-28 21:38:30 by panne]
panne [Tue, 28 Jan 2003 21:38:30 +0000 (21:38 +0000)] 
[project @ 2003-01-28 21:38:30 by panne]
After trying out re-exporting Foreign.Marshal.Pool from Marshal, it
became obvious that -fno-implicit-prelude would be a good idea. :-}
Otherwise one gets cirular dependencies to the Prelude. Alas, fixing
this resulted in some uglification of the code in some places...

17 years ago[project @ 2003-01-28 11:09:41 by simonmar]
simonmar [Tue, 28 Jan 2003 11:09:41 +0000 (11:09 +0000)] 
[project @ 2003-01-28 11:09:41 by simonmar]
Provide hand-optimised versions of all the functions herein, protected
by #ifdef __GLASGOW_HASKELL__.

In a quick test, withCString is at least 5 times faster than before.

This isn't really the right way to do it: we should get deforestation
working between the various component functions and let GHC do its
stuff, but I couldn't quite get that to work.

17 years ago[project @ 2003-01-28 11:07:39 by simonmar]
simonmar [Tue, 28 Jan 2003 11:07:39 +0000 (11:07 +0000)] 
[project @ 2003-01-28 11:07:39 by simonmar]
Hand-optimised versions of pokeArray and pokeArray0 (selected via
#ifdef __GLASGOW_HASKELL__).

I tried to make these functions amenable to deforestation, but
couildn't quite get it to work, so in the meantime we'll settle for
hand-written versions which are still quite a bit faster than the
originals.

17 years ago[project @ 2003-01-25 15:54:51 by wolfgang]
wolfgang [Sat, 25 Jan 2003 15:54:51 +0000 (15:54 +0000)] 
[project @ 2003-01-25 15:54:51 by wolfgang]
This commit fixes many bugs and limitations in the threaded RTS.
There are still some issues remaining, though.

The following bugs should have been fixed:

- [+] "safe" calls could cause crashes
- [+] yieldToReturningWorker/grabReturnCapability
    -     It used to deadlock.
- [+] couldn't wake blocked workers
    -     Calls into the RTS could go unanswered for a long time, and
          that includes ordinary callbacks in some circumstances.
- [+] couldn't block on an MVar and expect to be woken up by a signal
      handler
    -     Depending on the exact situation, the RTS shut down or
          blocked forever and ignored the signal.
- [+] The locking scheme in RtsAPI.c didn't work
- [+] run_thread label in wrong place (schedule())
- [+] Deadlock in GHC.Handle
    -     if a signal arrived at the wrong time, an mvar was never
          filled again
- [+] Signals delivered to the "wrong" thread were ignored or handled
      too late.

Issues:
*) If GC can move TSO objects (I don't know - can it?), then ghci
will occasionally crash when calling foreign functions, because the
parameters are stored on the TSO stack.

*) There is still a race condition lurking in the code
(both threaded and non-threaded RTS are affected):
If a signal arrives after the check for pending signals in
schedule(), but before the call to select() in awaitEvent(),
select() will be called anyway. The signal handler will be
executed much later than expected.

*) For Win32, GHC doesn't yet support non-blocking IO, so while a
thread is waiting for IO, no call-ins can happen. If the RTS is
blocked in awaitEvent, it uses a polling loop on Win32, so call-ins
should work (although the polling loop looks ugly).

*) Deadlock detection is disabled for the threaded rts, because I
don't know how to do it properly in the presence of foreign call-ins
from foreign threads.
This causes the tests conc031, conc033 and conc034 to fail.

*) "safe" is currently treated as "threadsafe". Implementing "safe" in
a way that blocks other Haskell threads is more difficult than was
thought at first. I think it could be done with a few additional lines
of code, but personally, I'm strongly in favour of abolishing the
distinction.

*) Running finalizers at program termination is inefficient - there
are two OS threads passing messages back and forth for every finalizer
that is run. Also (just as in the non-threaded case) the finalizers
are run in parallel to any remaining haskell threads and to any
foreign call-ins that might still happen.

17 years ago[project @ 2003-01-24 15:18:46 by malcolm]
malcolm [Fri, 24 Jan 2003 15:18:46 +0000 (15:18 +0000)] 
[project @ 2003-01-24 15:18:46 by malcolm]
Move the 'shiftL/R' and 'rotateL/R' variants to become methods of
the Bits class.  This gives an instance the choice of which methods
(directional, or unified) to implement directly.  (This change was
agreed in Sept 2002, but is only being committed now.)

Add instances for Int and Integer in nhc98.

17 years ago[project @ 2003-01-24 14:04:41 by simonmar]
simonmar [Fri, 24 Jan 2003 14:04:41 +0000 (14:04 +0000)] 
[project @ 2003-01-24 14:04:41 by simonmar]
- Generalise seq to allow an unlifted type in its second argument.  This
  works because seq is *always* inlined and replaced by a case.

- Remove getTag, a wired-in Id with an unfolding, with a definition
  in GHC.Base:

getTag x = x `seq` dataToTag# x

  this is why we required the above generalisation to seq (dataToTag#
  returns an Int#).  See the comments in GHC.Base for more details.

- As a side-effect, this fixes a bug in the interpreter, where the
  compiler optimised away the evaluation of the argument to dataToTag#,
  but the interpreter ended up passing it an unevaluated thunk (nullary
  constructors aren't always evaluated in GHCi, but the simplifier
  assumes they are).  Now, in the interpreter, getTag won't be inlined
  so the compiler can't optimise away the evaluation, and we're saved.

  The real bug here is either (a) dataToTag# requires an evaluated
  argument or (b) the interpreter doesn't supply it with one, take your
  pick.

17 years ago[project @ 2003-01-23 18:06:01 by panne]
panne [Thu, 23 Jan 2003 18:06:01 +0000 (18:06 +0000)] 
[project @ 2003-01-23 18:06:01 by panne]
Added (not-so-standard ;-) support for pooled memory management.
No GHC-specifics like the use of arenas yet...

17 years ago[project @ 2003-01-23 17:45:40 by ross]
ross [Thu, 23 Jan 2003 17:45:42 +0000 (17:45 +0000)] 
[project @ 2003-01-23 17:45:40 by ross]
Hugs now uses most of Control.Exception.

17 years ago[project @ 2003-01-23 11:46:57 by ross]
ross [Thu, 23 Jan 2003 11:46:57 +0000 (11:46 +0000)] 
[project @ 2003-01-23 11:46:57 by ross]
add Ord instance, as per FFI spec

17 years ago[project @ 2003-01-22 14:44:50 by ross]
ross [Wed, 22 Jan 2003 14:44:50 +0000 (14:44 +0000)] 
[project @ 2003-01-22 14:44:50 by ross]
simpler swapMVar (like readMVar): no need to unblock for a return.

17 years ago[project @ 2003-01-22 10:56:27 by ross]
ross [Wed, 22 Jan 2003 10:56:27 +0000 (10:56 +0000)] 
[project @ 2003-01-22 10:56:27 by ross]
use mallocForeignPtrArray from Foreign.ForeignPtr

17 years ago[project @ 2003-01-22 10:55:56 by ross]
ross [Wed, 22 Jan 2003 10:55:56 +0000 (10:55 +0000)] 
[project @ 2003-01-22 10:55:56 by ross]
add mallocForeignPtrArray and mallocForeignPtrArray0 as per latest FFI draft.

17 years ago[project @ 2003-01-21 16:33:20 by ross]
ross [Tue, 21 Jan 2003 16:33:20 +0000 (16:33 +0000)] 
[project @ 2003-01-21 16:33:20 by ross]
add local definitions of unsafeIOToST and stToIO

17 years ago[project @ 2003-01-17 14:52:17 by ross]
ross [Fri, 17 Jan 2003 14:52:19 +0000 (14:52 +0000)] 
[project @ 2003-01-17 14:52:17 by ross]
Exchange some functions between System.Mem.Weak (portable) and GHC.Weak (not).

17 years ago[project @ 2003-01-16 14:38:40 by ross]
ross [Thu, 16 Jan 2003 14:38:40 +0000 (14:38 +0000)] 
[project @ 2003-01-16 14:38:40 by ross]
remove spurious #ifdef __HUGS__

17 years ago[project @ 2003-01-13 11:42:16 by simonmar]
simonmar [Mon, 13 Jan 2003 11:42:16 +0000 (11:42 +0000)] 
[project @ 2003-01-13 11:42:16 by simonmar]
UArrays should always be initialized with known elements, otherwise we
can lose referential transparency:

Prelude> :m + Data.Array.Unboxed
Prelude Data.Array.Unboxed> let f () = array (1, 5) [] :: UArray Int Int
Prelude Data.Array.Unboxed> f () == f ()
False

Noticed-by: Tomasz Zielonka <t.zielonka@students.mimuw.edu.pl>
MERGE TO STABLE

17 years ago[project @ 2003-01-13 11:32:00 by simonmar]
simonmar [Mon, 13 Jan 2003 11:32:00 +0000 (11:32 +0000)] 
[project @ 2003-01-13 11:32:00 by simonmar]
Fix off-by-one in splitWithPS.

Noticed-by: Tomasz Zielonka <t.zielonka@students.mimuw.edu.pl>
MERGE TO STABLE

17 years ago[project @ 2003-01-08 14:08:29 by simonmar]
simonmar [Wed, 8 Jan 2003 14:08:29 +0000 (14:08 +0000)] 
[project @ 2003-01-08 14:08:29 by simonmar]
Fix annotateIOError (bug noticed by Ross Paterson).

17 years ago[project @ 2003-01-08 13:06:30 by simonmar]
simonmar [Wed, 8 Jan 2003 13:06:30 +0000 (13:06 +0000)] 
[project @ 2003-01-08 13:06:30 by simonmar]
Alter the order of the argument to annotateIOError to match mkIOError
and the FFI spec.

17 years ago[project @ 2003-01-06 14:30:12 by ross]
ross [Mon, 6 Jan 2003 14:30:12 +0000 (14:30 +0000)] 
[project @ 2003-01-06 14:30:12 by ross]
Consolidate to a single version of trace (except that GHC has the post-hook).
This version adds a newline, which the old Hugs and NHC versions didn't.

17 years ago[project @ 2003-01-02 23:49:32 by ross]
ross [Thu, 2 Jan 2003 23:49:32 +0000 (23:49 +0000)] 
[project @ 2003-01-02 23:49:32 by ross]
Hugs only: #ifndef out the bits Hugs can't do.

17 years ago[project @ 2002-12-23 13:33:16 by malcolm]
malcolm [Mon, 23 Dec 2002 13:33:16 +0000 (13:33 +0000)] 
[project @ 2002-12-23 13:33:16 by malcolm]
Ensure all the Storable instances are available in nhc98.

17 years ago[project @ 2002-12-20 18:43:53 by ross]
ross [Fri, 20 Dec 2002 18:43:53 +0000 (18:43 +0000)] 
[project @ 2002-12-20 18:43:53 by ross]
Hugs only: use new version of evaluate.

17 years ago[project @ 2002-12-20 17:56:21 by ross]
ross [Fri, 20 Dec 2002 17:56:22 +0000 (17:56 +0000)] 
[project @ 2002-12-20 17:56:21 by ross]
Make Hugs use all of System.IO.Error.

Also renamed the ioe_descr field of IOException (not part of the public
interface) to ioe_description, matching Hugs.

17 years ago[project @ 2002-12-20 09:41:20 by simonmar]
simonmar [Fri, 20 Dec 2002 09:41:20 +0000 (09:41 +0000)] 
[project @ 2002-12-20 09:41:20 by simonmar]
Remove c_uname from here, it isn't required in the base package

17 years ago[project @ 2002-12-20 09:31:11 by simonmar]
simonmar [Fri, 20 Dec 2002 09:31:11 +0000 (09:31 +0000)] 
[project @ 2002-12-20 09:31:11 by simonmar]
Oops, forgot to commit this with the "auto packages" changes.  We now
have to -#include "HsBase.h" explicitly.  As far as I can tell it was
happening by accident before, as a result of the base package being
enabled by default.

17 years ago[project @ 2002-12-19 22:06:20 by malcolm]
malcolm [Thu, 19 Dec 2002 22:06:20 +0000 (22:06 +0000)] 
[project @ 2002-12-19 22:06:20 by malcolm]
Add a couple more libraries for nhc98.

17 years ago[project @ 2002-12-19 22:04:41 by malcolm]
malcolm [Thu, 19 Dec 2002 22:04:41 +0000 (22:04 +0000)] 
[project @ 2002-12-19 22:04:41 by malcolm]
Make it work with nhc98.

17 years ago[project @ 2002-12-19 15:23:29 by ross]
ross [Thu, 19 Dec 2002 15:23:30 +0000 (15:23 +0000)] 
[project @ 2002-12-19 15:23:29 by ross]
#ifdef's for Hugs.

17 years ago[project @ 2002-12-18 16:29:25 by simonmar]
simonmar [Wed, 18 Dec 2002 16:29:25 +0000 (16:29 +0000)] 
[project @ 2002-12-18 16:29:25 by simonmar]
"Auto" packages.

The big change here is that it is no longer necessary to explicitly
say '-package X' on the command line if X is a package containing
hierarchical Haskell modules.  All packages marked "auto" contribute
to the import path, so their modules are always available.  At link
time, the compiler knows which packages are actually used by the
program, and it links in only those libraries needed.

There's one exception: one-shot linking.  If you link a program using

    ghc -o prog A.o B.o ...

then you need to explicitly add -package flags for each package
required (except base & haskell98) because the compiler has no
information about the package dependencies in this case.

Package configs have a new field: auto, which is either True or False.
Non-auto packages must be mentioned on the command-line as usual.
Non-auto packages are still required for:

  - non-hierarchical libraries (to avoid polluting the module namespace)

  - packages with no Haskell content

  - if you want more than one version of a package, or packages
    providing overlapping functionality where the user must decide
    which one to use.

Doc changes to follow...

17 years ago[project @ 2002-12-18 10:45:31 by malcolm]
malcolm [Wed, 18 Dec 2002 10:45:33 +0000 (10:45 +0000)] 
[project @ 2002-12-18 10:45:31 by malcolm]
Now compiles with nhc98.

17 years ago[project @ 2002-12-18 10:43:38 by malcolm]
malcolm [Wed, 18 Dec 2002 10:43:38 +0000 (10:43 +0000)] 
[project @ 2002-12-18 10:43:38 by malcolm]
Make it compilable with nhc98, although for now it omits all instances.

17 years ago[project @ 2002-12-18 10:42:54 by malcolm]
malcolm [Wed, 18 Dec 2002 10:42:54 +0000 (10:42 +0000)] 
[project @ 2002-12-18 10:42:54 by malcolm]
With nhc98, avoid overlap between Prelude defns and Control.Monad defns.

17 years ago[project @ 2002-12-18 10:42:09 by malcolm]
malcolm [Wed, 18 Dec 2002 10:42:09 +0000 (10:42 +0000)] 
[project @ 2002-12-18 10:42:09 by malcolm]
Make it work with nhc98.

17 years ago[project @ 2002-12-18 10:34:28 by malcolm]
malcolm [Wed, 18 Dec 2002 10:34:28 +0000 (10:34 +0000)] 
[project @ 2002-12-18 10:34:28 by malcolm]
Add a bunch more libraries to the nhc98 build.

17 years ago[project @ 2002-12-16 11:00:53 by malcolm]
malcolm [Mon, 16 Dec 2002 11:00:53 +0000 (11:00 +0000)] 
[project @ 2002-12-16 11:00:53 by malcolm]
Un-break for nhc98.  `bracket' now comes from IO, not System.IO.

17 years ago[project @ 2002-12-13 14:23:42 by simonmar]
simonmar [Fri, 13 Dec 2002 14:23:42 +0000 (14:23 +0000)] 
[project @ 2002-12-13 14:23:42 by simonmar]
Fix bugs caused by missing casts in arithmetic expressions in
stg_integerToInt64 and stg_integerToWord64.

17 years ago[project @ 2002-12-13 13:36:36 by malcolm]
malcolm [Fri, 13 Dec 2002 13:36:36 +0000 (13:36 +0000)] 
[project @ 2002-12-13 13:36:36 by malcolm]
Add #ifdef around import Control.Exception, which does not exist in nhc98.

17 years ago[project @ 2002-12-12 13:42:46 by ross]
ross [Thu, 12 Dec 2002 13:42:47 +0000 (13:42 +0000)] 
[project @ 2002-12-12 13:42:46 by ross]
Changes to the exception interface, as discussed on the libraries list.

1) Move bracket and bracket_ from GHC.Exception (and hence System.IO)
   to haskell98/IO.hs.  These two should now never be used (except in
   all-H98 programs), and this will save users of the new libraries from
   having to hide them.  Use the ones in Control.Exception instead.

2) Define

        type IOError = IOException      -- was Exception

   leaving the type of Prelude.ioError as IOError -> IO a,
   but adding to Control.Exception

        throwIO :: Exception -> IO a

The result is a type distinction between the variants of catch and try:

Prelude.catch           :: IO a -> (IOError -> IO a) -> IO a
Control.Exception.catch :: IO a -> (Exception -> IO a) -> IO a
System.IO.Error.try     :: IO a -> IO (Either IOError a)
Control.Exception.try   :: IO a -> IO (Either Exception a)

These are breaking changes: the first one affects only import lists,
but the second will bite in the following situations:

- using ioError on general Exceptions: use throwIO instead.

- using throw on IOErrors: if in the IO monad, use ioError instead.
  Otherwise, use throw (IOException e), but why are you throwing
  IO exceptions outside of the IO monad?

Minor changes:
- System.IO.Error now exports catch and try
- moved try from GHC.Exception to System.IO.Error, because it's
  portable and can be shared by Hugs.

17 years ago[project @ 2002-12-12 13:32:06 by ross]
ross [Thu, 12 Dec 2002 13:32:06 +0000 (13:32 +0000)] 
[project @ 2002-12-12 13:32:06 by ross]
Add an import for Hugs, and change some #ifdef __GLASGOW_HASKELL__ to
#ifndef __NHC__

17 years ago[project @ 2002-12-12 13:29:07 by ross]
ross [Thu, 12 Dec 2002 13:29:07 +0000 (13:29 +0000)] 
[project @ 2002-12-12 13:29:07 by ross]
Hugs only: add an import.

17 years ago[project @ 2002-12-11 16:12:22 by ross]
ross [Wed, 11 Dec 2002 16:12:22 +0000 (16:12 +0000)] 
[project @ 2002-12-11 16:12:22 by ross]
non-GHC: keep the old definition of Obj.

17 years ago[project @ 2002-12-11 15:55:17 by simonmar]
simonmar [Wed, 11 Dec 2002 15:55:17 +0000 (15:55 +0000)] 
[project @ 2002-12-11 15:55:17 by simonmar]
Obj type must be forall a.a now, to avoid confusing GHC's new
tail-calling scheme.

17 years ago[project @ 2002-12-05 14:44:02 by stolz]
stolz [Thu, 5 Dec 2002 14:44:02 +0000 (14:44 +0000)] 
[project @ 2002-12-05 14:44:02 by stolz]
Don't forget peeking signal handlers (nothing to see here, please move along)

17 years ago[project @ 2002-12-05 14:20:56 by stolz]
stolz [Thu, 5 Dec 2002 14:20:56 +0000 (14:20 +0000)] 
[project @ 2002-12-05 14:20:56 by stolz]
Add SA_RESETHAND (aka SA_ONESHOT) support.
Requested by: John Meacham

> module Main where

> import System.Posix.Signals

> main = do
>   installHandler sigUSR1 (Catch (print "usr1")) Nothing
>   installHandler sigUSR2 (CatchOnce (print "usr2")) Nothing
>   _ <- getLine
>   return ()

17 years ago[project @ 2002-12-05 09:49:38 by simonmar]
simonmar [Thu, 5 Dec 2002 09:49:38 +0000 (09:49 +0000)] 
[project @ 2002-12-05 09:49:38 by simonmar]
annotateIOError was somehow missing from the export list...

17 years ago[project @ 2002-12-03 14:30:12 by simonmar]
simonmar [Tue, 3 Dec 2002 14:30:12 +0000 (14:30 +0000)] 
[project @ 2002-12-03 14:30:12 by simonmar]
Eeek!  A nasty bug has been lurking in waitQSemN, which as far as I
can make out has been there for ever.  Presumably no-one uses this
abstraction...

The bug is that waitQSemN would discard any other blocked threads
(presumably waiting for a larger chunk of the semaphore) if it
succeeds.

It still looks to me like the quantity semaphores in here can suffer
from starvation: if one thread requests a large chunk, while lots of
other threads are requesting smaller chunks, then the thread
requesting the large chunk might never get to run.  I'm sure this must
be a well-known problem.

MERGE TO STABLE

17 years ago[project @ 2002-11-26 17:32:33 by ross]
ross [Tue, 26 Nov 2002 17:32:33 +0000 (17:32 +0000)] 
[project @ 2002-11-26 17:32:33 by ross]
added missing _ == _ = False to Eq Exception.

17 years ago[project @ 2002-11-22 10:52:23 by stolz]
stolz [Fri, 22 Nov 2002 10:52:23 +0000 (10:52 +0000)] 
[project @ 2002-11-22 10:52:23 by stolz]
Add 'mapException' as proposed in "A semantics for imprecise exceptions"

Reminded by: Lauri Alanko

17 years ago[project @ 2002-11-20 13:45:20 by simonmar]
simonmar [Wed, 20 Nov 2002 13:45:20 +0000 (13:45 +0000)] 
[project @ 2002-11-20 13:45:20 by simonmar]
Add experimental hDuplicate and hDuplicateTo.

17 years ago[project @ 2002-11-20 13:44:41 by simonmar]
simonmar [Wed, 20 Nov 2002 13:44:41 +0000 (13:44 +0000)] 
[project @ 2002-11-20 13:44:41 by simonmar]
Allow opening a character special device; we treat it as a stream,
even though it might be seekable.  This allows opening /dev/stdin,
/dev/null, etc.

MERGE TO STABLE

17 years ago[project @ 2002-11-19 11:28:51 by simonmar]
simonmar [Tue, 19 Nov 2002 11:28:51 +0000 (11:28 +0000)] 
[project @ 2002-11-19 11:28:51 by simonmar]
Doc fix for unsafeInterleaveIO

17 years ago[project @ 2002-11-13 10:35:18 by simonmar]
simonmar [Wed, 13 Nov 2002 10:35:18 +0000 (10:35 +0000)] 
[project @ 2002-11-13 10:35:18 by simonmar]
Remove superfluous escaping of quotation marks in the example code
(Haddock interprets bird-tracked code literally).

MERGE

17 years ago[project @ 2002-11-08 09:04:35 by simonpj]
simonpj [Fri, 8 Nov 2002 09:04:35 +0000 (09:04 +0000)] 
[project @ 2002-11-08 09:04:35 by simonpj]
---------------------------------
Tiny H98 fix to numericEnumFromThenTo
---------------------------------

This was a late fix to the H98 report: it only affects
[a,b..c]
where a=b, which isn't exactly common

17 years ago[project @ 2002-11-07 10:41:59 by stolz]
stolz [Thu, 7 Nov 2002 10:41:59 +0000 (10:41 +0000)] 
[project @ 2002-11-07 10:41:59 by stolz]
- Explicitely document order of parameters in addToFM_C.

17 years ago[project @ 2002-11-06 23:47:16 by ross]
ross [Wed, 6 Nov 2002 23:47:16 +0000 (23:47 +0000)] 
[project @ 2002-11-06 23:47:16 by ross]
Minor #elif adjustment (__HUGS__ vs __NHC__).

17 years ago[project @ 2002-11-06 20:30:26 by ross]
ross [Wed, 6 Nov 2002 20:30:26 +0000 (20:30 +0000)] 
[project @ 2002-11-06 20:30:26 by ross]
Hugs only: move the dummy implementation of evaluate here, to avoid ambiguity.

17 years ago[project @ 2002-11-06 10:38:16 by simonmar]
simonmar [Wed, 6 Nov 2002 10:38:16 +0000 (10:38 +0000)] 
[project @ 2002-11-06 10:38:16 by simonmar]
- Add a Show instance for ForeignPtr

- Fix the Eq instance for ForeignPtr to match the behaviour specified
  by the spec.  Two ForeignPtrs are equal iff their underlying Ptrs
  are equal (previously they were equal iff they were the same
  ForeignPtr).

MERGE TO STABLE

17 years ago[project @ 2002-11-02 11:56:30 by ross]
ross [Sat, 2 Nov 2002 11:56:30 +0000 (11:56 +0000)] 
[project @ 2002-11-02 11:56:30 by ross]
Hugs only: export throwIO :: Exception -> IO a instead of a generalized
ioError.  This is an interim measure to keep Hugs working until it's
decided what to do about IOError.

17 years ago[project @ 2002-10-30 18:21:25 by ross]
ross [Wed, 30 Oct 2002 18:21:25 +0000 (18:21 +0000)] 
[project @ 2002-10-30 18:21:25 by ross]
(Hugs only) fix silly slip in last commit.

17 years ago[project @ 2002-10-30 14:53:39 by ross]
ross [Wed, 30 Oct 2002 14:53:40 +0000 (14:53 +0000)] 
[project @ 2002-10-30 14:53:39 by ross]
#ifdef's for Hugs