Ian Lynagh [Thu, 7 Aug 2008 09:53:52 +0000 (09:53 +0000)]
Eq and Ord have moved into GHC.Classes
Ian Lynagh [Wed, 6 Aug 2008 23:29:48 +0000 (23:29 +0000)]
Use the proper CInt type in GHC.Unicode
Ian Lynagh [Wed, 6 Aug 2008 23:20:55 +0000 (23:20 +0000)]
Import wibbles
Ian Lynagh [Wed, 6 Aug 2008 23:06:23 +0000 (23:06 +0000)]
Remove unnecessary Data/Dynamic.hs-boot
Ian Lynagh [Wed, 6 Aug 2008 22:54:11 +0000 (22:54 +0000)]
Remove more redundant GHC.Float imports
Ian Lynagh [Wed, 6 Aug 2008 22:47:42 +0000 (22:47 +0000)]
Remove an unnecessary import
Ian Lynagh [Wed, 6 Aug 2008 19:15:54 +0000 (19:15 +0000)]
Move Int, Float and Double into ghc-prim:GHC.Types
Ian Lynagh [Wed, 6 Aug 2008 19:03:53 +0000 (19:03 +0000)]
Put some explicit import lists in Data.Typeable
Ian Lynagh [Wed, 6 Aug 2008 16:55:49 +0000 (16:55 +0000)]
Fix a couple of imports
Ian Lynagh [Wed, 6 Aug 2008 12:49:30 +0000 (12:49 +0000)]
Remove unused conditional import
Ian Lynagh [Wed, 6 Aug 2008 12:13:13 +0000 (12:13 +0000)]
Swap imports around to get GHC.ForeignPtr out of the base knot
Ian Lynagh [Wed, 6 Aug 2008 12:05:04 +0000 (12:05 +0000)]
Move some bits around to stop Data.Either being in the base import knot
Ian Lynagh [Wed, 6 Aug 2008 00:04:40 +0000 (00:04 +0000)]
Tweak an import
Ian Lynagh [Tue, 5 Aug 2008 23:47:20 +0000 (23:47 +0000)]
Remove the DynIOError constructor of IOErrorType
As far as I can see it is never used or exported
Ian Lynagh [Tue, 5 Aug 2008 22:13:41 +0000 (22:13 +0000)]
Move some internals around to simplify the import graph a bit
Ian Lynagh [Tue, 5 Aug 2008 20:40:09 +0000 (20:40 +0000)]
Move the Char datatype into ghc-prim
Ian Lynagh [Tue, 5 Aug 2008 18:23:36 +0000 (18:23 +0000)]
Remove an unnecessary import
Ian Lynagh [Tue, 5 Aug 2008 18:23:32 +0000 (18:23 +0000)]
The [] definition has moved to ghc-prim
Ian Lynagh [Tue, 5 Aug 2008 15:02:50 +0000 (15:02 +0000)]
Fix warnings
Ian Lynagh [Tue, 5 Aug 2008 14:28:11 +0000 (14:28 +0000)]
Add a missing case to Show AsyncException
Ian Lynagh [Mon, 4 Aug 2008 21:58:40 +0000 (21:58 +0000)]
Remove GHC.Dotnet
Ian Lynagh [Mon, 4 Aug 2008 21:16:17 +0000 (21:16 +0000)]
Hide standalone deriving clauses from haddock
Ian Lynagh [Mon, 4 Aug 2008 16:18:38 +0000 (16:18 +0000)]
Control.Exception doesn't need to export assertError
Ian Lynagh [Mon, 4 Aug 2008 16:09:41 +0000 (16:09 +0000)]
Generalise the type of mapException; pointed out by Isaac Dupree
Ian Lynagh [Mon, 4 Aug 2008 15:59:56 +0000 (15:59 +0000)]
Remove some unnecessary Data.Tuple imports
Ian Lynagh [Mon, 4 Aug 2008 15:54:20 +0000 (15:54 +0000)]
The tuple datatype definitions have moved to ghc-prim
Malcolm.Wallace@cs.york.ac.uk [Tue, 5 Aug 2008 16:03:30 +0000 (16:03 +0000)]
make ExitCode an instance of Exception for nhc98
Malcolm.Wallace@cs.york.ac.uk [Mon, 4 Aug 2008 16:06:16 +0000 (16:06 +0000)]
poke and peek come from Foreign.Storable
Malcolm.Wallace@cs.york.ac.uk [Mon, 4 Aug 2008 16:03:19 +0000 (16:03 +0000)]
zipWithM_ comes from Control.Monad
Malcolm.Wallace@cs.york.ac.uk [Mon, 4 Aug 2008 15:58:42 +0000 (15:58 +0000)]
Fix nhc98 code variations to use the extensible exception API.
There is still only one real exception type in nhc98, so it is not truly
extensible. But this is enough to get the base package building again.
Malcolm.Wallace@cs.york.ac.uk [Mon, 4 Aug 2008 13:38:53 +0000 (13:38 +0000)]
nhc98 needs the Prelude for this module
Ian Lynagh [Mon, 4 Aug 2008 00:41:47 +0000 (00:41 +0000)]
Change some imports and derive Show (Either a b)
rather than writing it by hand in GHC.Show
Ian Lynagh [Sun, 3 Aug 2008 18:03:45 +0000 (18:03 +0000)]
Windows fixes
Ian Lynagh [Sun, 3 Aug 2008 14:17:03 +0000 (14:17 +0000)]
Remove the duplicate definition of throwTo in Control.Exception
It now imports GHC.Conc, so it is no longer necessary
Ian Lynagh [Sun, 3 Aug 2008 14:19:44 +0000 (14:19 +0000)]
Remove the only import of GHC.Exts
Ian Lynagh [Sun, 3 Aug 2008 14:10:40 +0000 (14:10 +0000)]
Move assertError into GHC.IOBase
Ian Lynagh [Sun, 3 Aug 2008 11:41:04 +0000 (11:41 +0000)]
Use onException rather than catchAny
Ian Lynagh [Sun, 3 Aug 2008 00:30:01 +0000 (00:30 +0000)]
Generalise the type of onException
The type of the thing to do on an exception is now
IO b
rather than
IO ()
which better matches functions like bracket.
Ian Lynagh [Sat, 2 Aug 2008 23:13:58 +0000 (23:13 +0000)]
Remove the dangerous Exception functions
Removed: catchAny, handleAny, ignoreExceptions
These make it easy to eat /any/ exception, which is rarely what you want.
Normally you either want to:
* only catch exceptions in a certain part of the hierarchy, e.g.
"file not found", in which case you should only catch exceptions
of the appropriate type,
or
* you want to do some cleanup when an exception happens, and then rethrow
the exception, in which case you should use onException, or one of the
bracketing functions.
Ian Lynagh [Fri, 1 Aug 2008 23:03:43 +0000 (23:03 +0000)]
Remove an unused import
Ian Lynagh [Fri, 1 Aug 2008 23:00:59 +0000 (23:00 +0000)]
Remove unused imports
Ian Lynagh [Fri, 1 Aug 2008 22:58:47 +0000 (22:58 +0000)]
Remove unused imports in Control.Exception
Ian Lynagh [Fri, 1 Aug 2008 21:49:33 +0000 (21:49 +0000)]
Get rid of some duplicate imports
Ian Lynagh [Fri, 1 Aug 2008 21:47:07 +0000 (21:47 +0000)]
Remove the now-unused GHC/Conc.lhs-boot
Ian Lynagh [Fri, 1 Aug 2008 21:45:46 +0000 (21:45 +0000)]
Make some more imports non-recursive
Ian Lynagh [Fri, 1 Aug 2008 21:42:08 +0000 (21:42 +0000)]
Rejig some code so Control.Exception and GHC.Conc don't need recursive imports
Ian Lynagh [Fri, 1 Aug 2008 21:21:05 +0000 (21:21 +0000)]
Remove the now-unused GHC/TopHandler.lhs-boot
Ian Lynagh [Fri, 1 Aug 2008 21:18:01 +0000 (21:18 +0000)]
Reshuffle GHC.Conc/GHC.TopHandler a bit to remove a recursive import
Ian Lynagh [Fri, 1 Aug 2008 20:01:23 +0000 (20:01 +0000)]
Don't import Control.Concurrent.MVar in GHC.TopHandler
Ian Lynagh [Fri, 1 Aug 2008 11:17:16 +0000 (11:17 +0000)]
Export assertError from Control.Exception to make GHC happy
It's a wired-in name in GHC. We should possibly move it to another module.
Ian Lynagh [Thu, 31 Jul 2008 15:35:53 +0000 (15:35 +0000)]
TopHandler now uses the new extensible exceptions
Ian Lynagh [Wed, 30 Jul 2008 20:21:27 +0000 (20:21 +0000)]
Comment wibble
Ian Lynagh [Wed, 30 Jul 2008 20:20:49 +0000 (20:20 +0000)]
Make numericEnumFrom more efficient
Ian Lynagh [Wed, 30 Jul 2008 20:19:34 +0000 (20:19 +0000)]
Put in some parens to clarify how things parse
Bart Massey [Sat, 26 Jul 2008 08:04:44 +0000 (08:04 +0000)]
applied patches to make enumFrom and friends strict in arguments as per the Report; closes ticket #1997
Ian Lynagh [Wed, 30 Jul 2008 19:44:34 +0000 (19:44 +0000)]
Don't use "deriving Typeable" (for portability reasons)
Ian Lynagh [Wed, 30 Jul 2008 17:20:14 +0000 (17:20 +0000)]
Add onException
Ian Lynagh [Wed, 30 Jul 2008 17:19:51 +0000 (17:19 +0000)]
Fix whitespace
The space after "\begin{code}" was confusing haddock
Ian Lynagh [Wed, 30 Jul 2008 14:56:14 +0000 (14:56 +0000)]
Re-add blocked; it got lost in the extensible exceptions patches
Ian Lynagh [Wed, 30 Jul 2008 14:51:15 +0000 (14:51 +0000)]
Start to actually use extensible exceptions
Ian Lynagh [Wed, 30 Jul 2008 12:25:39 +0000 (12:25 +0000)]
Rejig the extensible exceptions so there is less circular importing
Ian Lynagh [Sat, 21 Jun 2008 14:44:20 +0000 (14:44 +0000)]
Define nonTermination for the RTS to use
We'll probably need to do the same for some other exceptions too
Ian Lynagh [Sat, 21 Jun 2008 12:15:01 +0000 (12:15 +0000)]
Use extensible exceptions at the lowest level
Everything above is largely unchanged; just the type of catch and throw.
Simon Marlow [Wed, 30 Jul 2008 11:45:59 +0000 (11:45 +0000)]
add comment
Simon Marlow [Wed, 30 Jul 2008 11:45:54 +0000 (11:45 +0000)]
add some big warnings to the docs for unsafeIOToSTM (#2401)
Simon Marlow [Wed, 30 Jul 2008 10:35:39 +0000 (10:35 +0000)]
FIX #2376: inline shiftR
Duplicating the default definition for shiftR doesn't seem quite right
to me, but it gets the right results when compiling the example
program, and I couldn't find a better way to do it.
Malcolm.Wallace@cs.york.ac.uk [Mon, 28 Jul 2008 16:45:37 +0000 (16:45 +0000)]
Add instance Show Control.Exception.Exception for nhc98.
Malcolm.Wallace@cs.york.ac.uk [Mon, 28 Jul 2008 16:34:45 +0000 (16:34 +0000)]
Extend nhc98's Exception type to resemble ghc's more closely
Ross Paterson [Tue, 15 Jul 2008 12:55:21 +0000 (12:55 +0000)]
fix dummy async implementations for non-GHC
Ian Lynagh [Thu, 10 Jul 2008 19:08:55 +0000 (19:08 +0000)]
Fix haddocking with older haddocks
Simon Marlow [Thu, 10 Jul 2008 15:17:11 +0000 (15:17 +0000)]
Add threadStatus :: ThreadId -> IO ThreadStatus
-- | The current status of a thread
data ThreadStatus
= ThreadRunning
-- ^the thread is currently runnable or running
| ThreadFinished
-- ^the thread has finished
| ThreadBlocked BlockReason
-- ^the thread is blocked on some resource
| ThreadDied
-- ^the thread received an uncaught exception
deriving (Eq,Ord,Show)
data BlockReason
= BlockedOnMVar
-- ^blocked on on 'MVar'
| BlockedOnBlackHole
-- ^blocked on a computation in progress by another thread
| BlockedOnException
-- ^blocked in 'throwTo'
| BlockedOnSTM
-- ^blocked in 'retry' in an STM transaction
| BlockedOnForeignCall
-- ^currently in a foreign call
| BlockedOnOther
-- ^blocked on some other resource. Without @-threaded@,
-- I/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@
-- they show up as 'BlockedOnMVar'.
deriving (Eq,Ord,Show)
This is useful for concurrency debugging. I've left threadStatus in
GHC.Conc for now, since the ThreadStatus type is somewhat GHC-specific.
Simon Marlow [Wed, 9 Jul 2008 13:55:58 +0000 (13:55 +0000)]
forkOS: start the new thread in blocked mode iff the parent was (#1048)
This matches the behaviour of forkIO
Simon Marlow [Wed, 9 Jul 2008 13:31:39 +0000 (13:31 +0000)]
Add Control.Exception.blocked :: IO Bool
Tells you whether async exceptions are currently blocked or not.
Simon Marlow [Wed, 9 Jul 2008 12:31:10 +0000 (12:31 +0000)]
FIX BUILD (on Windows)
Simon Marlow [Wed, 9 Jul 2008 12:25:27 +0000 (12:25 +0000)]
check CONST_SIGINT
Simon Marlow [Wed, 9 Jul 2008 11:10:08 +0000 (11:10 +0000)]
Make threadWaitRead/threadWaitWrite partially useable on Windows
They work with -threaded by calling fdReady() in a separate thread.
"threadWaitRead 0" also works without -threaded (because we happen to
know it's virtually equivalent to "hWaitForInput stdin (-1)").
Simon Marlow [Tue, 8 Jul 2008 13:42:54 +0000 (13:42 +0000)]
FIX #1198: hWaitForInput on Windows
Now we do the appropriate magic in fdReady() to detect when there is
real input available, as opposed to uninteresting console events.
Simon Marlow [Wed, 9 Jul 2008 09:44:37 +0000 (09:44 +0000)]
FIX part of #2301
Control-C now causes the new exception (AsyncException UserInterrupt)
to be raised in the main thread. The signal handler is set up by
GHC.TopHandler.runMainIO, and can be overriden in the usual way by
installing a new signal handler. The advantage is that now all
programs will get a chance to clean up on ^C.
When UserInterrupt is caught by the topmost handler, we now exit the
program via kill(getpid(),SIGINT), which tells the parent process that
we exited as a result of ^C, so the parent can take appropriate action
(it might want to exit too, for example).
One subtlety is that we have to use a weak reference to the ThreadId
for the main thread, so that the signal handler doesn't prevent the
main thread from being subject to deadlock detection.
Ian Lynagh [Tue, 24 Jun 2008 14:49:32 +0000 (14:49 +0000)]
() has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple
Ian Lynagh [Sun, 22 Jun 2008 14:15:59 +0000 (14:15 +0000)]
Add GHC.Exts.maxTupleSize :: Int, the size of the largest tuple supported
Ian Lynagh [Fri, 20 Jun 2008 19:45:21 +0000 (19:45 +0000)]
Remove code for older GHC versions
Ian Lynagh [Thu, 19 Jun 2008 23:58:08 +0000 (23:58 +0000)]
Make the macros in Typeable.h add type signatures
Simon Marlow [Thu, 19 Jun 2008 14:19:11 +0000 (14:19 +0000)]
Fix #2363: getChar cannot be interrupted with -threaded
Now in -threaded mode, instead of just making a blocking call to
read(), we call select() first to make sure the read() won't block,
and if it would block, then we use threadWaitRead.
The idea is that the current thread must be interruptible while it
blocks. This is a little slower than before, but the overhead only
applies to blocking Handles (stdin/stdout/stderr, and those created by
System.Process).
Ian Lynagh [Mon, 16 Jun 2008 23:07:27 +0000 (23:07 +0000)]
Remove -fglasgow-exts from pragmas and comments
Ian Lynagh [Mon, 16 Jun 2008 14:52:07 +0000 (14:52 +0000)]
Avoid using deprecated flags
Ross Paterson [Sun, 15 Jun 2008 22:44:13 +0000 (22:44 +0000)]
delete __hscore_{mkstemp,getrlimit,setrlimit} (moved to unix)
Ian Lynagh [Fri, 13 Jun 2008 20:17:54 +0000 (20:17 +0000)]
Update WCsubst.c for Unicode 5.1.0, and add a README.Unicode
README.Unicode describes how to do updates in the future.
Ian Lynagh [Fri, 13 Jun 2008 20:14:56 +0000 (20:14 +0000)]
Fix ubconfc
The current code doesn't seem to be what was used to generate WCsubst.c,
so I'm not sure if it never worked, or if my tools work slightly
differently to those of the previous user.
Twan van Laarhoven [Wed, 2 Jan 2008 23:17:12 +0000 (23:17 +0000)]
'permutations' is now more lazy and also faster
Twan van Laarhoven [Wed, 2 Jan 2008 23:16:29 +0000 (23:16 +0000)]
'subsequences' is now more lazy and also faster
Twan van Laarhoven [Tue, 18 Dec 2007 15:49:50 +0000 (15:49 +0000)]
Add 'subsequences' and 'permutations' to Data.List
Ian Lynagh [Sun, 1 Jun 2008 12:07:59 +0000 (12:07 +0000)]
Tweak the definition of (^) again
This fixes trac #2306 (do the minimum number of (*)s), and also means
that we don't use the value of (1 :: a) which causes problems if the
Num a definition isn't complete.
Simon Marlow [Tue, 27 May 2008 11:05:49 +0000 (11:05 +0000)]
note about evaluation affecting StableNames
Ian Lynagh [Tue, 20 May 2008 21:36:43 +0000 (21:36 +0000)]
Fix the build on Windows
Ian Lynagh [Tue, 20 May 2008 16:24:11 +0000 (16:24 +0000)]
Add wrappers for [gs]etrlimit
This is for #2038: macros are used in the Linux .h includes to redirect
to a 64-bit version when large file support is enabled.
Ian Lynagh [Tue, 20 May 2008 16:13:12 +0000 (16:13 +0000)]
Add a wrapper for mkstemp
This is for #2038: macros are used in the Linux .h includes to redirect
to a 64-bit version when large file support is enabled.
Simon Marlow [Fri, 9 May 2008 14:53:34 +0000 (14:53 +0000)]
Avoid calling varargs functions using the FFI
Calling varargs functions is explicitly deprecated according to the
FFI specification. It used to work, just about, but it broke with the
recent changes to the via-C backend to not use header files.
simonpj@microsoft.com [Fri, 2 May 2008 07:41:37 +0000 (07:41 +0000)]
Add comments about why rotate has an INLINE
Don Stewart [Thu, 1 May 2008 23:01:52 +0000 (23:01 +0000)]
Inline Data.Bits.rotate@Int, enables rotate to be constant folded
All other Bits instances seem to inline well enough on their own
to enable constant folding, e.g.
sumU . mapU (`shift` 3) . replicateU
10000000 $ (7 :: Int)
goes to:
Main.$wfold =
\ (ww_sOb :: Int#) (ww1_sOf :: Int#) ->
case ww1_sOf of wild_XM {
__DEFAULT -> Main.$wfold (+# ww_sOb 56) (+# wild_XM 1);
10000000 -> ww_sOb
}
With this patch, rotate gets inlined and folded too,
sumU . mapU (`rotate` 3) . replicateU
10000000 $ (7 :: Int)
to:
Main.$wfold =
\ (ww_sO7 :: Int#) (ww1_sOb :: Int#) ->
case ww1_sOb of wild_XM {
__DEFAULT -> Main.$wfold (+# ww_sO7 56) (+# wild_XM 1);
10000000 -> ww_sO7
Whereas it was left as a call to $wrotate before.
keller@cse.unsw.edu.au [Thu, 1 May 2008 02:42:23 +0000 (02:42 +0000)]
Moved def. of emptyP