Malcolm.Wallace@cs.york.ac.uk [Wed, 23 Dec 2009 14:26:25 +0000 (14:26 +0000)]
Restore previous Data.Typeable.typeOf*Default implementations for non-ghc.
Not all compilers have ScopedTypeVariables.
simonpj@microsoft.com [Fri, 18 Dec 2009 16:56:55 +0000 (16:56 +0000)]
Add comments about double bounds-checking, and fast paths for rectangular arrays
See Note [Double bounds-checking of index values] for the details.
The fast paths omit the doubled checks for cases we know about
simonpj@microsoft.com [Fri, 18 Dec 2009 15:51:17 +0000 (15:51 +0000)]
Fix Trac #3245: memoising typeOf
The performance bug in #3245 was caused by computing the typeRep
once for each call of typeOf, rather than once for each dictionary
contruction. (Computing TypeReps is reasonably expensive, because
of the hash-consing machinery.)
This is readily fixed by putting the TypeRep construction outside
the lambda. (Arguably GHC might have worked that out itself,
but it involves floating something between a type lambda and a
value lambda, which GHC doesn't currently do. If it happens a lot
we could fix that.)
simonpj@microsoft.com [Wed, 16 Dec 2009 17:04:41 +0000 (17:04 +0000)]
Mark 'index' as INLINE in GHC.Arr
This makes indexing much faster. See Trac #1216
Ian Lynagh [Sun, 6 Dec 2009 12:50:21 +0000 (12:50 +0000)]
Comment the remaining orphan instance modules
Ian Lynagh [Sat, 5 Dec 2009 18:12:38 +0000 (18:12 +0000)]
De-orphan Eq/Ord Float/Double
Ian Lynagh [Sat, 5 Dec 2009 16:58:54 +0000 (16:58 +0000)]
Add comments to "OPTIONS_GHC -fno-warn-orphans" pragmas
Malcolm.Wallace@cs.york.ac.uk [Wed, 2 Dec 2009 03:28:07 +0000 (03:28 +0000)]
Data.Either.partitionEithers was insufficiently lazy.
Spotted by Daniel Fischer.
Simon Marlow [Mon, 30 Nov 2009 14:44:09 +0000 (14:44 +0000)]
fix the docs regarding finalizer guarantees
Malcolm.Wallace@cs.york.ac.uk [Tue, 1 Dec 2009 03:37:45 +0000 (03:37 +0000)]
x86_64 requires more stack
Simon Marlow [Wed, 25 Nov 2009 14:38:22 +0000 (14:38 +0000)]
check for size < 0 in mallocForeignPtrBytes and friends (#3514)
Simon Marlow [Wed, 25 Nov 2009 12:34:35 +0000 (12:34 +0000)]
hGetContents: close the handle properly on error
When hGetContents caught an error it was closing the handle and then
throwing the exception, without updating the handle with the new
closed state. This lead to a double-closed, which was the cause of
*** glibc detected *** ./Setup: double free or corruption
when iconv_close was called twice on the decoder.
See http://hackage.haskell.org/trac/hackage/ticket/609
Roman Leshchinskiy [Thu, 26 Nov 2009 23:22:19 +0000 (23:22 +0000)]
Fix arities of mapFB and zipFB
Ian Lynagh [Thu, 26 Nov 2009 12:34:04 +0000 (12:34 +0000)]
Remove an unnecessary -fno-warn-orphans flag
Ian Lynagh [Wed, 25 Nov 2009 23:23:49 +0000 (23:23 +0000)]
Tweak layout to work with alternative layout rule
Ian Lynagh [Wed, 25 Nov 2009 19:41:47 +0000 (19:41 +0000)]
Tweak layout to be accepted by the alternative layout rul
Roman Leshchinskiy [Wed, 25 Nov 2009 01:00:03 +0000 (01:00 +0000)]
Make sure zipWithFB has arity 2
It gets 2 arguments in the "zipWith" rule but its arity was higher and the new
inliner didn't inline it sometimes, for instance here:
mpp :: [Double] -> [Double] -> [Double] -> [Double] -> [Double]
mpp as bs cs ds = zipWith (*) (zipWith (+) as bs) (zipWith (+) cs ds)
This was a regression vs. 6.10.
Ian Lynagh [Tue, 24 Nov 2009 13:46:47 +0000 (13:46 +0000)]
Remove an old comment
Ian Lynagh [Tue, 24 Nov 2009 13:36:39 +0000 (13:36 +0000)]
De-orphan the Eq/Ord Integer instances
Ian Lynagh [Tue, 24 Nov 2009 13:34:21 +0000 (13:34 +0000)]
Whitespace only
Ian Lynagh [Tue, 24 Nov 2009 01:17:47 +0000 (01:17 +0000)]
Derive some more instances, rather than writing them by hand
Ian Lynagh [Tue, 24 Nov 2009 01:14:16 +0000 (01:14 +0000)]
We can now derive Ord ()
Ian Lynagh [Mon, 23 Nov 2009 23:33:43 +0000 (23:33 +0000)]
De-orphan tuple Eq/Ord instances
Ian Lynagh [Mon, 23 Nov 2009 22:49:05 +0000 (22:49 +0000)]
Control.Exception.Base no longer has any orphans
Ian Lynagh [Mon, 23 Nov 2009 22:35:44 +0000 (22:35 +0000)]
De-orphan the MonadFix ST instance for GHC
Ian Lynagh [Mon, 23 Nov 2009 22:27:02 +0000 (22:27 +0000)]
Rearrange the contents of Control.Monad.ST; no functionality changes
Ian Lynagh [Mon, 23 Nov 2009 21:56:35 +0000 (21:56 +0000)]
De-orphan the Eq/Ord [a] instances
Ian Lynagh [Mon, 23 Nov 2009 20:22:53 +0000 (20:22 +0000)]
De-orphan the Eq/Ord Char instances
Ian Lynagh [Mon, 23 Nov 2009 20:18:17 +0000 (20:18 +0000)]
De-orphan the Eq/Ord Bool instances
Ian Lynagh [Mon, 23 Nov 2009 19:43:10 +0000 (19:43 +0000)]
Move Eq/Ord Ordering instances to de-orphan them
Malcolm.Wallace@cs.york.ac.uk [Mon, 23 Nov 2009 06:37:43 +0000 (06:37 +0000)]
Remove ffi warnings for nhc98.
Simon Marlow [Wed, 11 Nov 2009 15:19:15 +0000 (15:19 +0000)]
Second attempt to fix #1185 (forkProcess and -threaded)
Patch 2/2: first patch is to ghc
This time without dynamic linker hacks, instead I've expanded the
existing rts/Globals.c to cache more CAFs, specifically those in
GHC.Conc. We were already using this trick for signal handlers, I
should have realised before.
It's still quite unsavoury, but we can do away with rts/Globals.c in
the future when we switch to a dynamically-linked GHCi.
Simon Marlow [Fri, 6 Nov 2009 14:06:29 +0000 (14:06 +0000)]
Rollback #1185 fix
rolling back:
Tue Nov 3 16:05:40 GMT 2009 Simon Marlow <marlowsd@gmail.com>
* Fix #1185: restart the IO manager after fork()
This is the libraries/base part of the patch; there is a corresponding
patch to GHC itself.
The main change is that we now keep track of the IO manager's ThreadId
in a top-level MVar, and ensureIOManagerIsRunning checks whether a
previous IO manager thread is alive before starting one. In the child
of fork(), we can hence call ensureIOManagerIsRunning to restart the
IO manager.
M ./GHC/Conc.lhs -46 +44
Wed Nov 4 17:49:45 GMT 2009 Ian Lynagh <igloo@earth.li>
* Fix the build on Windows
M ./GHC/Conc.lhs -6 +4
Ian Lynagh [Wed, 4 Nov 2009 17:49:45 +0000 (17:49 +0000)]
Fix the build on Windows
Simon Marlow [Tue, 3 Nov 2009 16:05:40 +0000 (16:05 +0000)]
Fix #1185: restart the IO manager after fork()
This is the libraries/base part of the patch; there is a corresponding
patch to GHC itself.
The main change is that we now keep track of the IO manager's ThreadId
in a top-level MVar, and ensureIOManagerIsRunning checks whether a
previous IO manager thread is alive before starting one. In the child
of fork(), we can hence call ensureIOManagerIsRunning to restart the
IO manager.
Simon Marlow [Fri, 16 Oct 2009 11:24:04 +0000 (11:24 +0000)]
improve the documentation for throwErrnoIfRetry
simonpj@microsoft.com [Thu, 29 Oct 2009 13:53:50 +0000 (13:53 +0000)]
Don't inline unpackFoldrCString ever
simonpj@microsoft.com [Thu, 29 Oct 2009 13:53:30 +0000 (13:53 +0000)]
Inline more default methods
Namely Monad: (>>)
Eq: (==), (/=)
Num: (-), negate
Real: quot, rem, div, mod, recip, (/), truncate
Float: (**), logBase, sqrt, tan, tanh
simonpj@microsoft.com [Thu, 29 Oct 2009 13:51:18 +0000 (13:51 +0000)]
Move error messages out of INLINEd default methods
No need to duplicate the error generation!
simonpj@microsoft.com [Thu, 29 Oct 2009 13:50:41 +0000 (13:50 +0000)]
Exploit now-working default-method INLINE pragmas for Data.Bits
* Add INLINE pragmas to default methods for class Bits
* Remove redundant instance methods elsewhere, now that
the default method will do the job
simonpj@microsoft.com [Thu, 29 Oct 2009 13:44:14 +0000 (13:44 +0000)]
Tidy up and comment imports
simonpj@microsoft.com [Thu, 29 Oct 2009 13:43:35 +0000 (13:43 +0000)]
Inline foldr and (.) when applied to two arguments not three
The new INLINE story is (by design) arity-sensitive, so we must
put fewer argument on the LHS for foldr and (.)
Malcolm.Wallace@cs.york.ac.uk [Tue, 13 Oct 2009 09:38:33 +0000 (09:38 +0000)]
dirUtils.c no longer available
Simon Marlow [Mon, 12 Oct 2009 15:29:55 +0000 (15:29 +0000)]
Make hGetContents throw an exception if an error is encountered
Strictly speaking this breaks Haskell 98 compatibility, which requires
hGetContents to just end the lazy stream silently if an error is
encountered. However, for a few reasons we think it will make
everyone's life a bit easier if we make this change
1. Errors will be a lot more common in GHC 6.12.1, in the form
of Unicode decoding errors.
2. When Haskell 98 was designed, we didn't know how to throw
exceptions from inside lazy I/O, but now we do.
3. If anyone is actually relying on the previous behaviour, their
code is arguably broken.
Malcolm.Wallace@cs.york.ac.uk [Tue, 13 Oct 2009 09:28:43 +0000 (09:28 +0000)]
Re-instate System.Console.Getopt for nhc98 builds.
Although it was split out of base a while back, that change was
reverted for ghc soon afterwards, but nhc98 never noticed.
Ian Lynagh [Fri, 9 Oct 2009 18:56:18 +0000 (18:56 +0000)]
Roll back "Another instance of nhc98's strange import semantics."
Fri Oct 9 14:50:51 BST 2009 Malcolm.Wallace@cs.york.ac.uk
GHC (correctly) warns about the unused import, which breaks the validate
build.
Ian Lynagh [Fri, 9 Oct 2009 18:47:04 +0000 (18:47 +0000)]
Roll back "Cope with nhc98's (occasionally-strange) import semantics"
Fri Oct 9 14:43:51 BST 2009 Malcolm.Wallace@cs.york.ac.uk
GHC (correctly) warns about the unused import, which breaks the validate
build.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:52:42 +0000 (13:52 +0000)]
It seems that nhc98 needs defaulting in Data.Fixed.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:50:51 +0000 (13:50 +0000)]
Another instance of nhc98's strange import semantics.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:48:21 +0000 (13:48 +0000)]
Make Data.Functor compatible with non-GHC compilers.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:43:51 +0000 (13:43 +0000)]
Cope with nhc98's (occasionally-strange) import semantics.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:40:01 +0000 (13:40 +0000)]
Fix gratuitous breakage of nhc98 in System.IO.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:36:15 +0000 (13:36 +0000)]
Fix gratuitous breakage of nhc98 in Control.Exception.Base.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:33:30 +0000 (13:33 +0000)]
Fix gratuitous breakage of non-GHC in Data.Fixed.
Malcolm.Wallace@cs.york.ac.uk [Fri, 9 Oct 2009 13:32:57 +0000 (13:32 +0000)]
Fix gratuitous breakage for non-GHC in Data.Bits.
Simon Marlow [Tue, 6 Oct 2009 10:02:07 +0000 (10:02 +0000)]
Use UTF-32LE instead of UTF32LE
The latter is not recognised by some iconv implementations.
Ben.Lippmeier@anu.edu.au [Wed, 30 Sep 2009 08:42:29 +0000 (08:42 +0000)]
Strip any Byte Order Mark (BOM) from the front of decoded streams.
When decoding to UTF-32, Solaris iconv inserts a BOM at the front
of the stream, but Linux iconv doesn't.
Simon Marlow [Mon, 5 Oct 2009 10:15:54 +0000 (10:15 +0000)]
use UTF32BE/UTF32LE instead of UCS-4/UCS-4LE
Ben.Lippmeier@anu.edu.au [Wed, 30 Sep 2009 08:42:29 +0000 (08:42 +0000)]
Strip any Byte Order Mark (BOM) from the front of decoded streams.
When decoding to UTF-32, Solaris iconv inserts a BOM at the front
of the stream, but Linux iconv doesn't.
Simon Marlow [Fri, 25 Sep 2009 14:12:57 +0000 (14:12 +0000)]
Add traceEvent :: String -> IO ()
For emitting an event via the RTS tracing framework
Simon Marlow [Wed, 23 Sep 2009 09:05:36 +0000 (09:05 +0000)]
Fix the error message when flushing the read buffer of a non-seekable Handle
Simon Marlow [Wed, 23 Sep 2009 09:04:45 +0000 (09:04 +0000)]
Fix #3534: No need to flush the byte buffer when setting binary mode
Simon Marlow [Wed, 16 Sep 2009 14:04:54 +0000 (14:04 +0000)]
Use let !y = x in .. x .. instead of seq in $! and evaluate (#2273)
Ross Paterson [Tue, 15 Sep 2009 17:31:09 +0000 (17:31 +0000)]
make some Applicative functions into methods, and split off Data.Functor (proposal #3335)
The following functions
(<$) :: Functor f => a -> f b -> f a
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
some :: Alternative f => f a -> f [a]
many :: Alternative f => f a -> f [a]
are moved into the corresponding classes, with the existing implementations
as default definitions. This gives people creating instances the option of
defining specialized implementations of these functions, though they should
be equivalent to the default definitions.
Although (<$) is now a method of the Functor class, it is hidden in the
re-export by the Prelude, Control.Monad and Monad. The new module
Data.Functor exposes the full class, plus the function (<$>). These are
also re-exported by Control.Applicative.
Judah Jacobson [Sun, 13 Sep 2009 02:21:26 +0000 (02:21 +0000)]
On Windows, use the console code page for text file encoding/decoding.
We keep all of the code page tables in the module
GHC.IO.Encoding.CodePage.Table. That file was generated automatically
by running codepages/MakeTable.hs; more details are in the comments at the
start of that script.
Storing the lookup tables adds about 40KB to each statically linked executable;
this only increases the size of a "hello world" program by about 7%.
Currently we do not support double-byte encodings (Chinese/Japanese/Korean), since
including those codepages would increase the table size to 400KB. It will be
straightforward to implement them once the work on library DLLs is finished.
Ian Lynagh [Fri, 11 Sep 2009 21:04:37 +0000 (21:04 +0000)]
Fix "init" docs: the input list need not be finite. Fixes trac #3465
Ian Lynagh [Fri, 11 Sep 2009 15:39:13 +0000 (15:39 +0000)]
Bump base version to 4.2.0.0
Simon Marlow [Sun, 30 Aug 2009 15:28:50 +0000 (15:28 +0000)]
Address #3310
- Rename BlockedOnDeadMVar -> BlockedIndefinitelyOnMVar
- Rename BlockedIndefinitely -> BlockedIndefinitelyOnSTM
- instance Show BlockedIndefinitelyOnMVar is now
"blocked indefinitely in an MVar operation"
- instance Show BlockedIndefinitelyOnSTM is now
"blocked indefinitely in an STM transaction"
clients using Control.OldException will be unaffected (the new
exceptions are mapped to the old names). However, for base4-compat
we'll need to make a version of catch/try that does a similar
mapping.
Ben.Lippmeier@anu.edu.au [Sun, 30 Aug 2009 13:00:28 +0000 (13:00 +0000)]
Fix unicode conversion for MSB architectures
This fixes the SPARC/Solaris build.
Simon Marlow [Sun, 30 Aug 2009 07:59:09 +0000 (07:59 +0000)]
Fix #3441: detect errors in partial sequences
Simon Marlow [Thu, 27 Aug 2009 15:21:16 +0000 (15:21 +0000)]
Fix hWaitForInput
It was erroneously waiting when there were bytes to decode waiting in
the byte buffer.
Simon Marlow [Thu, 27 Aug 2009 15:06:28 +0000 (15:06 +0000)]
fix debugging code
Matthias Kilian [Wed, 26 Aug 2009 15:44:06 +0000 (15:44 +0000)]
Allow for configurable iconv include and library locations.
This should help to fix the build on OpenBSD.
Simon Marlow [Wed, 26 Aug 2009 08:52:52 +0000 (08:52 +0000)]
typo in comment
Simon Marlow [Tue, 25 Aug 2009 15:24:57 +0000 (15:24 +0000)]
un-hide some modules from the Haddock docs
Simon Marlow [Wed, 19 Aug 2009 12:07:00 +0000 (12:07 +0000)]
Apply fix for #1548, from squadette@gmail.com
Ashley Yakeley [Wed, 12 Aug 2009 05:50:58 +0000 (05:50 +0000)]
improvements to Data.Fixed: instances for Typeable and Data, more predefined types
Ian Lynagh [Tue, 11 Aug 2009 21:58:56 +0000 (21:58 +0000)]
Fix "Cabal check" warnings
Ian Lynagh [Sun, 9 Aug 2009 18:32:52 +0000 (18:32 +0000)]
Add a GHC.Constants module; fixes trac #3094
Ian Lynagh [Sun, 9 Aug 2009 13:47:17 +0000 (13:47 +0000)]
Apply proposal #3393
Add openTempFileWithDefaultPermissions and
openBinaryTempFileWithDefaultPermissions.
Ian Lynagh [Fri, 7 Aug 2009 20:06:31 +0000 (20:06 +0000)]
Add some more C wrappers; patch from Krister Walfridsson
Fixes 21 testsuite errors on NetBSD 5.99.
Alexander Dunlap [Wed, 5 Aug 2009 06:07:48 +0000 (06:07 +0000)]
Fixing configure for autoconf 2.64
Ross Paterson [Thu, 6 Aug 2009 14:28:53 +0000 (14:28 +0000)]
add INLINE toList
In anticipation of the fixing of #2353.
Simon Marlow [Wed, 5 Aug 2009 13:40:45 +0000 (13:40 +0000)]
fix a copyright
Simon Marlow [Wed, 5 Aug 2009 13:40:36 +0000 (13:40 +0000)]
Tweak the BufferedIO class to enable a memory-mapped file implementation
We have to eliminate the assumption that an empty write buffer can be
constructed by setting the buffer pointers to zero: this isn't
necessarily the case when the buffer corresponds to a memory-mapped
file, or other in-memory device implementation.
Ian Lynagh [Tue, 4 Aug 2009 14:39:10 +0000 (14:39 +0000)]
Deprecate Control.OldException
Simon Marlow [Mon, 3 Aug 2009 13:11:21 +0000 (13:11 +0000)]
Windows build fix, following RTS tidyup
Simon Marlow [Sat, 1 Aug 2009 22:07:43 +0000 (22:07 +0000)]
Updates to follow the RTS tidyup
C functions like isDoubleNaN moved here (primFloat.c)
Ian Lynagh [Wed, 22 Jul 2009 01:31:51 +0000 (01:31 +0000)]
Add integer-simple as a build option
Ian Lynagh [Tue, 21 Jul 2009 22:24:40 +0000 (22:24 +0000)]
Use shift[LR]Integer in the Bits Integer instance
Ian Lynagh [Tue, 21 Jul 2009 18:52:28 +0000 (18:52 +0000)]
depend directly on integer-gmp, rather than indirecting through integer
Simon Marlow [Wed, 22 Jul 2009 10:21:30 +0000 (10:21 +0000)]
Move the instances of Functor and Monad IO to GHC.Base, to avoid orphans
Simon Marlow [Tue, 21 Jul 2009 09:38:54 +0000 (09:38 +0000)]
move "instance Exception Dynamic" so it isn't an orphan
Ian Lynagh [Sun, 19 Jul 2009 15:32:28 +0000 (15:32 +0000)]
Improve the index checking for array accesses; fixes #2120 #2669
As well as checking that offset we are reading is actually inside the
array, we now also check that it is "in range" as defined by the Ix
instance. This fixes confusing behaviour (#2120) and improves some error
messages (#2669).
Ian Lynagh [Sat, 18 Jul 2009 15:10:49 +0000 (15:10 +0000)]
Make chr say what its argument was, if it's a bad argument
Simon Marlow [Wed, 15 Jul 2009 12:44:16 +0000 (12:44 +0000)]
remove unused warning
Simon Marlow [Wed, 15 Jul 2009 12:28:39 +0000 (12:28 +0000)]
warning fix: -fno-implicit-prelude -> -XNoImplicitPrelude
Simon Marlow [Wed, 15 Jul 2009 12:25:19 +0000 (12:25 +0000)]
Add hGetEncoding :: Handle -> IO (Maybe TextEncoding)
as suggested during the discussion on the libraries list
Simon Marlow [Wed, 15 Jul 2009 12:24:14 +0000 (12:24 +0000)]
Add more documentation to mkTextEncoding
noting that "//IGNORE" and "//TRANSLIT" suffixes can be used with GNU
iconv.
Simon Marlow [Wed, 15 Jul 2009 12:22:57 +0000 (12:22 +0000)]
Add the utf8_bom codec
as suggested during the discussion on the libraries list.