ghc-base.git
21 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.

21 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.

21 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  >:-)

21 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

21 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

21 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

21 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

21 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.)

21 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

21 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

21 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.

21 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.

21 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??

21 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

21 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.

21 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...

21 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

21 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...

21 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.

21 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.

21 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.

21 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.

21 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.

21 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...

21 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.

21 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

21 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.

21 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

21 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.

21 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

21 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).

21 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__

21 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

21 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

21 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).

21 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.

21 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.

21 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.

21 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.

21 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.

21 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.

21 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

21 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.

21 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.

21 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.

21 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.

21 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...

21 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.

21 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.

21 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.

21 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.

21 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.

21 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.

21 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.

21 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.

21 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.

21 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__

21 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.

21 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.

21 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.

21 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)

21 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 ()

21 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...

21 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

21 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.

21 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

21 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.

21 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

21 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

21 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

21 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

21 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.

21 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__).

21 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.

21 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

21 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.

21 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.

21 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

21 years ago[project @ 2002-10-25 13:07:41 by sof]
sof [Fri, 25 Oct 2002 13:07:41 +0000 (13:07 +0000)]
[project @ 2002-10-25 13:07:41 by sof]
Only interested in a subset when used in w/ Hugs

21 years ago[project @ 2002-10-24 07:49:40 by mthomas]
mthomas [Thu, 24 Oct 2002 07:49:40 +0000 (07:49 +0000)]
[project @ 2002-10-24 07:49:40 by mthomas]
Unchecked quick fix. Hope to test tonight after getting home.

21 years ago[project @ 2002-10-22 10:59:40 by simonmar]
simonmar [Tue, 22 Oct 2002 10:59:40 +0000 (10:59 +0000)]
[project @ 2002-10-22 10:59:40 by simonmar]
Don't bogusly cast ThreadId# to Ptr ().  The right way to fix these
warnings is to change the type signatures of cmp_thread and
rts_getThreadId to take StgPtr rather than StgTSO *, since the
compiler now has no internal distinction between the two in the
backend (it used to, but recent simplifications removed the
distinction).

21 years ago[project @ 2002-10-18 16:29:18 by malcolm]
malcolm [Fri, 18 Oct 2002 16:29:18 +0000 (16:29 +0000)]
[project @ 2002-10-18 16:29:18 by malcolm]
Implement atomicModifyIORef for nhc98.

21 years ago[project @ 2002-10-18 13:32:56 by simonpj]
simonpj [Fri, 18 Oct 2002 13:32:57 +0000 (13:32 +0000)]
[project @ 2002-10-18 13:32:56 by simonpj]
Move Typable IORef instance to Dynamic; stops IORef.hs being an oprhan module

21 years ago[project @ 2002-10-18 12:28:38 by ross]
ross [Fri, 18 Oct 2002 12:28:38 +0000 (12:28 +0000)]
[project @ 2002-10-18 12:28:38 by ross]
Hugs only: simple version of atomicModifyIORef, relying on the absence
of preemption from Hugs.  If Hugs gets Haskell finalizers, they'll have
to be blocked during this operation.

21 years ago[project @ 2002-10-18 09:51:04 by simonmar]
simonmar [Fri, 18 Oct 2002 09:51:04 +0000 (09:51 +0000)]
[project @ 2002-10-18 09:51:04 by simonmar]
Add atomicModifyIORef, as discussed on the FFI list.

21 years ago[project @ 2002-10-16 13:48:24 by ross]
ross [Wed, 16 Oct 2002 13:48:24 +0000 (13:48 +0000)]
[project @ 2002-10-16 13:48:24 by ross]
Remove special treatment of Hugs.

21 years ago[project @ 2002-10-14 10:06:28 by ross]
ross [Mon, 14 Oct 2002 10:06:28 +0000 (10:06 +0000)]
[project @ 2002-10-14 10:06:28 by ross]
#ifdef tweaks

21 years ago[project @ 2002-10-11 14:33:58 by simonpj]
simonpj [Fri, 11 Oct 2002 14:33:58 +0000 (14:33 +0000)]
[project @ 2002-10-11 14:33:58 by simonpj]
Fix cpp syntax

21 years ago[project @ 2002-10-11 12:23:41 by stolz]
stolz [Fri, 11 Oct 2002 12:23:41 +0000 (12:23 +0000)]
[project @ 2002-10-11 12:23:41 by stolz]
Add even more #ifdefs for nhc98.

21 years ago[project @ 2002-10-11 11:05:20 by malcolm]
malcolm [Fri, 11 Oct 2002 11:05:20 +0000 (11:05 +0000)]
[project @ 2002-10-11 11:05:20 by malcolm]
Make some more libraries buildable with nhc98.

21 years ago[project @ 2002-10-09 17:24:12 by malcolm]
malcolm [Wed, 9 Oct 2002 17:24:13 +0000 (17:24 +0000)]
[project @ 2002-10-09 17:24:12 by malcolm]
Add #ifdefs for nhc98.

21 years ago[project @ 2002-10-09 17:08:18 by malcolm]
malcolm [Wed, 9 Oct 2002 17:08:19 +0000 (17:08 +0000)]
[project @ 2002-10-09 17:08:18 by malcolm]
Add #ifdefs for nhc98.

21 years ago[project @ 2002-10-09 16:55:30 by malcolm]
malcolm [Wed, 9 Oct 2002 16:55:30 +0000 (16:55 +0000)]
[project @ 2002-10-09 16:55:30 by malcolm]
Add a little infrastructure for building the hierarchical libraries
with nhc98.

21 years ago[project @ 2002-10-08 08:03:01 by wolfgang]
wolfgang [Tue, 8 Oct 2002 08:03:02 +0000 (08:03 +0000)]
[project @ 2002-10-08 08:03:01 by wolfgang]
Make the new Posix bindings compile on Mac OS X.
Most notable, Mac OS X lacks
*) lchown
*) SIGPOLL
I don't know of a replacement of either, so they are just left out when
they are not detected by configure.

21 years ago[project @ 2002-10-03 15:19:15 by ross]
ross [Thu, 3 Oct 2002 15:19:15 +0000 (15:19 +0000)]
[project @ 2002-10-03 15:19:15 by ross]
Reinstate the exports of the function names, because the module must
export them, even though Hugs doesn't define them here.  The old module
export they overlapped with was there to pick up the tuple definitions
for GHC, but that probably isn't necessary with the recent GHC changes.

21 years ago[project @ 2002-10-03 13:56:12 by panne]
panne [Thu, 3 Oct 2002 13:56:12 +0000 (13:56 +0000)]
[project @ 2002-10-03 13:56:12 by panne]
Warning police #9: Nuked modules from the export list which are
already implied by other exported modules. Still quite a few warnings
left here, though... >:-(

21 years ago[project @ 2002-10-03 13:41:35 by panne]
panne [Thu, 3 Oct 2002 13:41:35 +0000 (13:41 +0000)]
[project @ 2002-10-03 13:41:35 by panne]
Warning police #8: Exporting Foo(..) exports Foo's field selector
functions, too, so let's nuke the latter from the export list.

21 years ago[project @ 2002-10-03 13:29:07 by panne]
panne [Thu, 3 Oct 2002 13:29:07 +0000 (13:29 +0000)]
[project @ 2002-10-03 13:29:07 by panne]
Warning police #7: Improved typing of TSOs a bit, getting rid of a
bunch of C compiler warnings.

21 years ago[project @ 2002-10-03 13:04:58 by panne]
panne [Thu, 3 Oct 2002 13:04:58 +0000 (13:04 +0000)]
[project @ 2002-10-03 13:04:58 by panne]
Warning police #6: Add prototype for writeErrString__, which is used
by GHC.TopHandler.

21 years ago[project @ 2002-10-03 12:57:42 by panne]
panne [Thu, 3 Oct 2002 12:57:42 +0000 (12:57 +0000)]
[project @ 2002-10-03 12:57:42 by panne]
Warning police #5: Nuked duplicate exports, simplifying (i.e. nuking
:-) the export list on the way. The deep and arcane reasons for the
strange #ifdef-ery in this module are not clear to me, so I hope no
damage is done by this commit. :-}