Tue Jun 23 13:27:51 IDT 2009 Yitzchak Gale
* Additional explicit method implementations in the Foldable and Traversable instances for Prelude types
New patches:
[Additional explicit method implementations in the Foldable and Traversable instances for Prelude types
Yitzchak Gale **20090623102751
Ignore-this: bb8619d2c7438acf482e9bf2a0138efe
] {
hunk ./Data/Foldable.hs 146
-- instances for Prelude types
instance Foldable Maybe where
+ foldMap _ Nothing = mempty
+ foldMap f (Just x) = f x
+
foldr _ z Nothing = z
foldr f z (Just x) = f x z
hunk ./Data/Foldable.hs 155
foldl _ z Nothing = z
foldl f z (Just x) = f z x
+ foldr1 _ Nothing = error "foldr1 of Nothing"
+ foldr1 _ (Just x) = x
+
+ foldl1 _ Nothing = error "foldl1 of Nothing"
+ foldl1 _ (Just x) = x
+
instance Foldable [] where
foldr = Prelude.foldr
foldl = Prelude.foldl
hunk ./Data/Foldable.hs 169
instance Ix i => Foldable (Array i) where
foldr f z = Prelude.foldr f z . elems
+ foldl f z = Prelude.foldl f z . elems
+ foldr1 f = Prelude.foldr1 f . elems
+ foldl1 f = Prelude.foldl1 f . elems
-- | Fold over the elements of a structure,
-- associating to the right, but strictly.
hunk ./Data/Traversable.hs 42
import Prelude hiding (mapM, sequence, foldr)
import qualified Prelude (mapM, foldr)
+import qualified Control.Monad (sequence)
import Control.Applicative
import Data.Foldable (Foldable())
import Data.Monoid (Monoid)
hunk ./Data/Traversable.hs 115
where cons_f x ys = (:) f x ys
mapM = Prelude.mapM
+ sequence = Control.Monad.sequence
instance Ix i => Traversable (Array i) where
traverse f arr = listArray (bounds arr) `fmap` traverse f (elems arr)
}
Context:
[Unconditionally make a (Show Ptr) instance
Ian Lynagh **20090620204809
It used to only exist if (WORD_SIZE_IN_BITS == 32 || WORD_SIZE_IN_BITS == 64)
]
[Remove AC_C_CONST
Ian Lynagh **20090615203240
It was breaking the build on Windows. The problem was that we included
stdio.h which gave a prototype for some functions (e.g. remove), then
the AC_C_CONST meant that we did
/* Define to empty if `const' does not conform to ANSI C. */
#define const /**/
and then we included io.h which gave prototypes that, due to const
being removed, conflicted with the earlier prototypes.
]
[Remove old Integer prototypes
Ian Lynagh **20090615202444]
[Redefine gcdInt to use gcdInteger rather than gcdInt# primop
Duncan Coutts **20090612142951
The gcdInt# primop uses gmp internally, even though the interface is
just Int#. Since we want to get gmp out of the rts we cannot keep
gcdInt#, however it's also a bit odd for the integer package to export
something that doesn't actually use Integer in its interface. Using
gcdInteger is still not terribly satisfactory aesthetically. However
in the short-term it works and it is no slower since gcdInteger calls
gcdInt# for the special case of two small Integers.
]
[The IO type has moved to GHC.Types in ghc-prim
Ian Lynagh **20090620155208]
[Fix warnings in configure script
Ian Lynagh **20090615214850]
[Fix warnings in C programs generated by configure; fixes failures with -Werror
Ian Lynagh **20090615201634]
[Save and restore the codec state when re-decoding
Simon Marlow **20090614185332
Ignore-this: 62b247a51efc2eed65d933f982b06894
We previously had an ugly hack to check for a BOM when re-decoding
some binary data in flushCharBuffer. The hack was there essentially
because codecs like UTF-16 have a state, and we had not restored it.
This patch gives codecs an explicit state, and implemented
saving/restoring of the state as necessary. Hence, the hack in
flushCharBuffer is replaced by a more general mechanism that works for
any codec with state.
Unfortunately, iconv doesn't give us a way to save and restore the
state, so this is currently only implemented for the built-in codecs.
]
[Fix #3128: file descriptor leak when hClose fails
Simon Marlow **20090616110755
Ignore-this: 5b6a51fed9239c61d16d0151cb5b59d3
]
[Allow System.Posix.Internals to compile with nhc98 again.
Malcolm.Wallace@cs.york.ac.uk**20090615155249
Also affects GHC.IO.Device, which is not very GHC-specific at all.
]
[Add iconv as an extra library on platform that need to link with it
Ian Lynagh **20090612231307
For example, we need -liconv on OS X.
]
[Rewrite of the IO library, including Unicode support
Simon Marlow **20090612135631
Ignore-this: fbd43ec854ac5df442e7bf647de8ca5a
Highlights:
* Unicode support for Handle I/O:
** Automatic encoding and decoding using a per-Handle encoding.
** The encoding defaults to the locale encoding (only on Unix
so far, perhaps Windows later).
** Built-in UTF-8, UTF-16 (BE/LE), and UTF-32 (BE/LE) codecs.
** iconv-based codec for other encodings on Unix
* Modularity: the low-level IO interface is exposed as a type class
(GHC.IO.IODevice) so you can build your own low-level IO providers and
make Handles from them.
* Newline translation: instead of being Windows-specific wired-in
magic, the translation from \r\n -> \n and back again is available
on all platforms and is configurable for reading/writing
independently.
Unicode-aware Handles
~~~~~~~~~~~~~~~~~~~~~
This is a significant restructuring of the Handle implementation with
the primary goal of supporting Unicode character encodings.
The only change to the existing behaviour is that by default, text IO
is done in the prevailing locale encoding of the system (except on
Windows [1]).
Handles created by openBinaryFile use the Latin-1 encoding, as do
Handles placed in binary mode using hSetBinaryMode.
We provide a way to change the encoding for an existing Handle:
GHC.IO.Handle.hSetEncoding :: Handle -> TextEncoding -> IO ()
and various encodings (from GHC.IO.Encoding):
latin1,
utf8,
utf16, utf16le, utf16be,
utf32, utf32le, utf32be,
localeEncoding,
and a way to lookup other encodings:
GHC.IO.Encoding.mkTextEncoding :: String -> IO TextEncoding
(it's system-dependent whether the requested encoding will be
available).
We may want to export these from somewhere more permanent; that's a
topic for a future library proposal.
Thanks to suggestions from Duncan Coutts, it's possible to call
hSetEncoding even on buffered read Handles, and the right thing
happens. So we can read from text streams that include multiple
encodings, such as an HTTP response or email message, without having
to turn buffering off (though there is a penalty for switching
encodings on a buffered Handle, as the IO system has to do some
re-decoding to figure out where it should start reading from again).
If there is a decoding error, it is reported when an attempt is made
to read the offending character from the Handle, as you would expect.
Performance varies. For "hGetContents >>= putStr" I found the new
library was faster on my x86_64 machine, but slower on an x86. On the
whole I'd expect things to be a bit slower due to the extra
decoding/encoding, but probabaly not noticeably. If performance is
critical for your app, then you should be using bytestring and text
anyway.
[1] Note: locale encoding is not currently implemented on Windows due
to the built-in Win32 APIs for encoding/decoding not being sufficient
for our purposes. Ask me for details. Offers of help gratefully
accepted.
Newline Translation
~~~~~~~~~~~~~~~~~~~
In the old IO library, text-mode Handles on Windows had automatic
translation from \r\n -> \n on input, and the opposite on output. It
was implemented using the underlying CRT functions, which meant that
there were certain odd restrictions, such as read/write text handles
needing to be unbuffered, and seeking not working at all on text
Handles.
In the rewrite, newline translation is now implemented in the upper
layers, as it needs to be since we have to perform Unicode decoding
before newline translation. This means that it is now available on
all platforms, which can be quite handy for writing portable code.
For now, I have left the behaviour as it was, namely \r\n -> \n on
Windows, and no translation on Unix. However, another reasonable
default (similar to what Python does) would be to do \r\n -> \n on
input, and convert to the platform-native representation (either \r\n
or \n) on output. This is called universalNewlineMode (below).
The API is as follows. (available from GHC.IO.Handle for now, again
this is something we will probably want to try to get into System.IO
at some point):
-- | The representation of a newline in the external file or stream.
data Newline = LF -- ^ "\n"
| CRLF -- ^ "\r\n"
deriving Eq
-- | Specifies the translation, if any, of newline characters between
-- internal Strings and the external file or stream. Haskell Strings
-- are assumed to represent newlines with the '\n' character; the
-- newline mode specifies how to translate '\n' on output, and what to
-- translate into '\n' on input.
data NewlineMode
= NewlineMode { inputNL :: Newline,
-- ^ the representation of newlines on input
outputNL :: Newline
-- ^ the representation of newlines on output
}
deriving Eq
-- | The native newline representation for the current platform
nativeNewline :: Newline
-- | Map "\r\n" into "\n" on input, and "\n" to the native newline
-- represetnation on output. This mode can be used on any platform, and
-- works with text files using any newline convention. The downside is
-- that @readFile a >>= writeFile b@ might yield a different file.
universalNewlineMode :: NewlineMode
universalNewlineMode = NewlineMode { inputNL = CRLF,
outputNL = nativeNewline }
-- | Use the native newline representation on both input and output
nativeNewlineMode :: NewlineMode
nativeNewlineMode = NewlineMode { inputNL = nativeNewline,
outputNL = nativeNewline }
-- | Do no newline translation at all.
noNewlineTranslation :: NewlineMode
noNewlineTranslation = NewlineMode { inputNL = LF, outputNL = LF }
-- | Change the newline translation mode on the Handle.
hSetNewlineMode :: Handle -> NewlineMode -> IO ()
IO Devices
~~~~~~~~~~
The major change here is that the implementation of the Handle
operations is separated from the underlying IO device, using type
classes. File descriptors are just one IO provider; I have also
implemented memory-mapped files (good for random-access read/write)
and a Handle that pipes output to a Chan (useful for testing code that
writes to a Handle). New kinds of Handle can be implemented outside
the base package, for instance someone could write bytestringToHandle.
A Handle is made using mkFileHandle:
-- | makes a new 'Handle'
mkFileHandle :: (IODevice dev, BufferedIO dev, Typeable dev)
=> dev -- ^ the underlying IO device, which must support
-- 'IODevice', 'BufferedIO' and 'Typeable'
-> FilePath
-- ^ a string describing the 'Handle', e.g. the file
-- path for a file. Used in error messages.
-> IOMode
-- ^ The mode in which the 'Handle' is to be used
-> Maybe TextEncoding
-- ^ text encoding to use, if any
-> NewlineMode
-- ^ newline translation mode
-> IO Handle
This also means that someone can write a completely new IO
implementation on Windows based on native Win32 HANDLEs, and
distribute it as a separate package (I really hope somebody does
this!).
This restructuring isn't as radical as previous designs. I haven't
made any attempt to make a separate binary I/O layer, for example
(although hGetBuf/hPutBuf do bypass the text encoding and newline
translation). The main goal here was to get Unicode support in, and
to allow others to experiment with making new kinds of Handle. We
could split up the layers further later.
API changes and Module structure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NB. GHC.IOBase and GHC.Handle are now DEPRECATED (they are still
present, but are just re-exporting things from other modules now).
For 6.12 we'll want to bump base to version 5 and add a base4-compat.
For now I'm using #if __GLASGOW_HASKEL__ >= 611 to avoid deprecated
warnings.
I split modules into smaller parts in many places. For example, we
now have GHC.IORef, GHC.MVar and GHC.IOArray containing the
implementations of IORef, MVar and IOArray respectively. This was
necessary for untangling dependencies, but it also makes things easier
to follow.
The new module structurue for the IO-relatied parts of the base
package is:
GHC.IO
Implementation of the IO monad; unsafe*; throw/catch
GHC.IO.IOMode
The IOMode type
GHC.IO.Buffer
Buffers and operations on them
GHC.IO.Device
The IODevice and RawIO classes.
GHC.IO.BufferedIO
The BufferedIO class.
GHC.IO.FD
The FD type, with instances of IODevice, RawIO and BufferedIO.
GHC.IO.Exception
IO-related Exceptions
GHC.IO.Encoding
The TextEncoding type; built-in TextEncodings; mkTextEncoding
GHC.IO.Encoding.Types
GHC.IO.Encoding.Iconv
GHC.IO.Encoding.Latin1
GHC.IO.Encoding.UTF8
GHC.IO.Encoding.UTF16
GHC.IO.Encoding.UTF32
Implementation internals for GHC.IO.Encoding
GHC.IO.Handle
The main API for GHC's Handle implementation, provides all the Handle
operations + mkFileHandle + hSetEncoding.
GHC.IO.Handle.Types
GHC.IO.Handle.Internals
GHC.IO.Handle.Text
Implementation of Handles and operations.
GHC.IO.Handle.FD
Parts of the Handle API implemented by file-descriptors: openFile,
stdin, stdout, stderr, fdToHandle etc.
]
[Remove unused foreign imports of __encodeFloat/Double
Duncan Coutts **20090611160100]
[nhc98 must build dirUtils.c as well.
Malcolm.Wallace@cs.york.ac.uk**20090605091730
Fixes this bootstrapping error:
Undefined symbols:
"___hscore_readdir", referenced from:
_FR_System_46Posix_46Internals_46readdir_35 in libHSbase.a(Internals.o)
]
[Remove unnecessary parens
Ian Lynagh **20090602183608]
[Fix validate (on Windows)
Simon Marlow **20090529130214
Ignore-this: ea31ee9b26cd69b81bb24ecf040dc196
]
[Make two type defaults explicit
simonpj@microsoft.com**20090529083549
Ignore-this: 398a10db1612dbef1723b449bff26782
Now that -Werror rejects programs that use silent type-class defaulting,
we must commit in the source code.
I've used Double in CPUTime, which is the same as was picked automatically
before, but I expect Float would be ok.
realToInteger :: Real a => a -> Integer
realToInteger ct = round (realToFrac ct :: Double)
In GHC.Float I used Float (rather that than the auto-picked Double)
because I'm pretty certain it has enough precision.
-- f :: Integer, log :: Float -> Float,
-- ceiling :: Float -> Int
ceiling ((log (fromInteger (f+1) :: Float) +
]
[Fix #3257: document that exitWith in a forkIO'd thread does not exit the process
Simon Marlow **20090528123738
Ignore-this: cc5aff45a149acd1627bd7ee31aea4e9
]
[Increase the version number to that in the 6.10 branch
Ian Lynagh **20090524155610]
[Fix warnings
Ian Lynagh **20090523224508]
[Document that the initial quantity for QSem and QSemN must be >= 0
Ian Lynagh **20090523200238]
[add _O_NOINHERIT when opening files on Windows (see #2650)
Simon Marlow **20090520130926
Ignore-this: 6dfbdfe13e739cc339e627294e077ba6
]
[remove msvcrt and kernel32 from extra-libraries
Simon Marlow **20090520111626
Ignore-this: cd2e24a5144c6ca0efe03ceaea8f577b
]
[Add wrappers around fcntl
Ian Lynagh **20090520175358
We need to do this as it has a (, ...) type, which we aren't allowed to
directly call with the FFI.
]
[Add more bang patterns, needed to fix the 32bit build
Ian Lynagh **20090424160701]
[Use a bang pattern when we where/let-bind values with unlifted types
Ian Lynagh **20090424125320]
[FIX #3171: make sure we have only one table of signal handlers
Simon Marlow **20090423112837
Ignore-this: 3d8039b47efac2629e73a7d7e7d58983
]
[Fix QSem and QSemN: Initial amount must be non-negative
Ian Lynagh **20090410164013]
[Don't inline enumDeltaToInteger until its rules have had a chance to fire
simonpj@microsoft.com**20090403091750
Ignore-this: ab602bac65610e720065b097d46a6f52
]
[Import GHC.Err so we see bottoming functions properly
simonpj@microsoft.com**20090403091118
Ignore-this: 913e3a4584e73e67ddf9bc3b6f11d11
Before this patch, GHC/Err.lhs-boot exported divZeroError and overflowError,
as well as plain 'error'. The latter has a wired-in defn in GHC (MkId.lhs),
but the former two do not. As a result GHC doesn't see that overflowError
is a bottoming function at a crucial moment when compiling GHC.Real, and
that means that divMod wasn't getting the CPR property.
The fix is easy:
- GHC/Err.lhs-boot should export only 'error'
- GHC.Real, GHC.Int, and GHC.Word should import GHC.Err
directly. They can do this nowadays without creating
a module loop, thanks to the new exception story
]
[Don't inline unpackCString
simonpj@microsoft.com**20090403090844
Ignore-this: 78f9660ffff55ae8bc4c41866d1ad80c
There's no point in inlining unpackCString, so this patch adds a
NOINLINE pragma. (Otherwise, it's just on the threshold.)
]
[be sure to install Nhc98BaseConfig.h
Malcolm.Wallace@cs.york.ac.uk**20090401122028]
[Avoid unnecessarily using Integer when decoding Floats
Ian Lynagh **20090330225241]
[Add another Data.List.intersect example from Christian Maeder
Ian Lynagh **20090327232118]
[Remove some redundant fromInteger's
Ian Lynagh **20090324145325]
[Add an import needed in the new build system
Ian Lynagh **20090322162241]
[ghcconfig.h is __GLASGOW_HASKELL__ only
Malcolm.Wallace@cs.york.ac.uk**20090316134532]
[Fix layout to comply with H'98.
Malcolm.Wallace@cs.york.ac.uk**20090316125651
Also, configure correctly for nhc98, to avoid win32 code.
]
[FIX #2189: re-enabled cooked mode for Console-connected Handles on Windows
Simon Marlow *-20090305113323
Patch from Sigbjorn Finne
]
[avoid a space leak building up in the "prodding" IORef (part of #2992)
Simon Marlow **20090311093938]
[Partial fix for #2917
Simon Marlow **20090305154153
Ignore-this: 3a06cd3ea09f1d6454d52031802a93fd
- add newAlignedPinnedByteArray# for allocating pinned BAs with
arbitrary alignment
- the old newPinnedByteArray# now aligns to 16 bytes
Foreign.alloca will use newAlignedPinnedByteArray#, and so might end
up wasting less space than before (we used to align to 8 by default).
Foreign.allocaBytes and Foreign.mallocForeignPtrBytes will get 16-byte
aligned memory, which is enough to avoid problems with SSE
instructions on x86, for example.
There was a bug in the old newPinnedByteArray#: it aligned to 8 bytes,
but would have failed if the header was not a multiple of 8
(fortunately it always was, even with profiling). Also we
occasionally wasted some space unnecessarily due to alignment in
allocatePinned().
I haven't done anything about Foreign.malloc/mallocBytes, which will
give you the same alignment guarantees as malloc() (8 bytes on
Linux/x86 here).
]
[Add config.guess, config.sub and install-sh
Ian Lynagh **20090307153831]
[add final newline; fix build (on Windows?)
Simon Marlow **20090305120426]
[FIX #2189: re-enabled cooked mode for Console-connected Handles on Windows
Simon Marlow **20090305113323
Patch from Sigbjorn Finne
]
[Rules to make genericLength strict for Int/Integer lengths, see #2962
naur@post11.tele.dk**20090207181427]
[#2759: Amend previous patch
Jose Pedro Magalhaes **20090212132327]
[ifdef out the definition of setCloseOnExec on Windows; fixes the build
Ian Lynagh **20090220173041]
[Fix warnings: put imports inside ifdefs
Ian Lynagh **20090220173941]
[ifdef out the syncIOManager export on Windows; fixes the build
Ian Lynagh **20090220173414]
[Set the IO manager pipe descriptors to FD_CLOEXEC
Simon Marlow **20090219114217
Ignore-this: ac670a45f8a4d06dd7831a2674d6c119
This pipe is an internal implementation detail, we don't really want
it to be exposed.
]
[Rewrite of signal-handling (base patch; see also ghc and unix patches)
Simon Marlow **20090219102203
Ignore-this: 2122e05eaaab184b9ef0f269ce4c9282
The API is the same (for now). The new implementation has the
capability to define signal handlers that have access to the siginfo
of the signal (#592), but this functionality is not exposed in this
patch.
#2451 is the ticket for the new API.
The main purpose of bringing this in now is to fix race conditions in
the old signal handling code (#2858). Later we can enable the new
API in the HEAD.
Implementation differences:
- More of the signal-handling is moved into Haskell. We store the
table of signal handlers in an MVar, rather than having a table of
StablePtrs in the RTS.
- In the threaded RTS, the siginfo of the signal is passed down the
pipe to the IO manager thread, which manages the business of
starting up new signal handler threads. In the non-threaded RTS,
the siginfo of caught signals is stored in the RTS, and the
scheduler starts new signal handler threads.
]
[Fix #2971: we had lost the non-blocking flag on Handles created by openFile
Simon Marlow **20090206165912
Ignore-this: 546f1a799b6e80f7b25c73ef642d8f9d
This code is a mess, fortunately the new IO library cleans it up.
]
[add some rules of thumb for catching exceptions, restructure the docs a bit
Simon Marlow **20090205150642
Ignore-this: 8294e58f247b2cc3f193991434d336de
]
[implement System.IO.Error more fully for nhc98
Malcolm.Wallace@cs.york.ac.uk**20090206173314]
[Make System.Posix.Internals buildable by nhc98.
Malcolm.Wallace@cs.york.ac.uk**20090206111152]
[Fix #2903: ensure CWStringLen contains the length of the array rather than the String
Ross Paterson **20090203011026]
[OldException catches unknown exceptions as DynException
Ian Lynagh **20090202151856
It's important that we put all exceptions into the old Exception
type somehow, or throwing a new exception wouldn't cause the
cleanup code for bracket, finally etc to happen.
]
[Update the Exception docs
Ian Lynagh **20090131204845]
[Require Cabal version >= 1.6
Ian Lynagh **20090122011251]
[Add "bug-reports" and "source-repository" info to the Cabal file
Ian Lynagh **20090121182010]
[Proposal #2875: remove StringRep and StringConstr
Jose Pedro Magalhaes **20090116142617]
[Fix #2759: add mkRealConstr and mkIntegralConstr, deprecate mkFloatConstr and mkIntConstr
Jose Pedro Magalhaes **20090116140655]
[Correct SYB's representation of Char
Jose Pedro Magalhaes **20081211144716]
[avoid `mappend` in monoid laws, because it doesn't work with haddock
Ross Paterson **20090118011508]
[Make Data.Typeable imports and exports more explicit
Ian Lynagh **20090114234512]
[add Monoid laws
Ross Paterson **20090116151624]
[Unbreak an import cycle caused by moving 'catch' definitions around.
Malcolm.Wallace@cs.york.ac.uk**20090116110132
The new cycle was introduced for nhc98 only.
]
[make the Monoid docs more self-contained
Ross Paterson **20090115222441]
[Move some catch definitions around to avoid an import loop
Ian Lynagh **20090114211033
As suggested by simonpj in trac #2822.
]
[Add NoImplicitPrelude to the extensions used when building with GHC
Ian Lynagh **20090114202810]
[#2699: exit silently for EPIPE on stdout
Simon Marlow **20090114134612
Ignore-this: 4236560e8e9c1135129e9526355f11b4
]
[Fix build when we have HTYPE_TCFLAG_T
Ian Lynagh **20090105102020]
[Fix the build on Windows
Ian Lynagh **20090105014625]
[Add errno to the IOError type
Ian Lynagh **20090104173018]
[Fix typo (reqwests -> requests); trac #2908, spotted by bancroft
Ian Lynagh **20090104154405]
[More compact error messages for record selectors
simonpj@microsoft.com**20090102145325
Make recSelError generate the standard part of the record selector
error message (i.e. "No match in record selector") rather than have
that string duplicated for every record selector.
]
[extra dependencies for the new build system
Simon Marlow **20081217104655]
[warning fix: don't use -XPatternSignatures in GHC >= 6.10
Simon Marlow **20081217104637]
[Rollback INLINE patches
Simon Marlow **20081216104143
rolling back:
Fri Dec 5 17:00:15 GMT 2008 simonpj@microsoft.com
* Update INLINE pragmas for new INLINE story
- (.) and foldr should inline when applied to only two arguments
- Make unpackCString# NOINLINE; it inlines too much (with little gain)
M ./GHC/Base.lhs -10 +31
]
[FIX #1364: added support for C finalizers that run as soon as the value is no longer reachable.
Ivan Tomac **20081210150510
Patch amended by Simon Marlow:
- mkWeakFinalizer# commoned up with mkWeakFinalizerEnv#
]
[Fix #2760: deprecate mkNorepType, add mkNoRepType
Jose Pedro Magalhaes **20081121141905]
[Update INLINE pragmas for new INLINE story
simonpj@microsoft.com**20081205170015
- (.) and foldr should inline when applied to only two arguments
- Make unpackCString# NOINLINE; it inlines too much (with little gain)
]
[Fix #2750: change Prelude.(,) to Prelude.(,,)
Jose Pedro Magalhaes **20081201113411]
[Fix typo (or out of date reference) in throwTo documentation.
shelarcy **20081129024639]
[Add more description of what "round" does, from the H98 report
Ian Lynagh **20081119143131]
[re-instate the gcd/Integer and lcm/Integer RULES
Simon Marlow **20081120101826
Fixes a performance regression between 6.8.3 and 6.10.1
]
[Change an "undefined" into a more informative error; trac #2782
Ian Lynagh **20081116160228]
[updating Haddock documentation
jpm@cs.uu.nl**20081111095023
Fixed the broken link from Data.Generics to Data.Data.
]
[add GHC.Conc.runSparks (required by GHC patch "Run sparks in batches")
Simon Marlow **20081106095419]
[FIX #2722: update RULES for the Category/Arrow split
Ross Paterson **20081104144515
The rule
arr id = id
interacts unpleasantly with the advice to define
id = arr id
in instances of Category that are also instances of Arrow (#2722).
Also changed a couple of >>>'s to .'s in later rules.
]
[Add AnnotationWrapper type so GHC can capture annotation dictionaries during compilation
Max Bolingbroke **20081016122608]
[docs about how exceptions are handled by forkIO'd threads (#2651)
Simon Marlow **20081016100410]
[Import n_capabilities via import symbol when linking dynamically
Clemens Fruhwirth **20081013161220]
[add link to the new syb wiki
jpm@cs.uu.nl**20081013111605]
[changing haddock links
jpm@cs.uu.nl**20081010095434]
[add readTVarIO :: TVar a -> IO a
Simon Marlow **20081010113835]
[removed (->) instance from Data.Data
jpm@cs.uu.nl**20081006075254]
[non-GHC: delete unnecessary imports
Ross Paterson **20081007134809]
[added new module Data.Data
'Jose Pedro Magalhaes '**20081002140535
The new Data.Data module contains all of Data.Generics.Basics
and most of Data.Generics.Instances. The missing instances were
deemed dubious and moved to the syb package.
]
[add new Data.Data module
'Jose Pedro Magalhaes '**20081002082735]
[restore Complex's derived Data instance
'Jose Pedro Magalhaes '**20081002082655]
[update Data.Generics import
'Jose Pedro Magalhaes '**20081002082604]
[Don't use ^(2::Int) in Data.Complex.magnitude; partially fixes trac #2450
Ian Lynagh **20081004142651
We still might want to make a RULE for this, so the bug is not fully fixed.
]
[Restore the Haskell 98 behaviour of Show Ratio (#1920)
Simon Marlow **20080923134949]
[Pad version number to 4.0.0.0
Ian Lynagh **20080920155801]
[TAG 6.10 branch has been forked
Ian Lynagh **20080919123437]
[In nhc98, Word is a type synonym, so class instance is not possible.
Malcolm.Wallace@cs.york.ac.uk**20080917075326]
[Fix bugs in Text.Printf (#1548)
Simon Marlow **20080916133505]
[We should be including Rts.h here, not Stg.h
Simon Marlow **20080912134901
Stg.h is for .hc files only, and it sets up various global register
variables.
]
[Generic functions that take integral arguments should work the same way as their prelude counterparts
**20080822022755
The Prelude functions drop, take, and splitAt are unfailing (never call error). This patch changes the Data.List generic versions to behave the same way. At present, they call error on negative arguments.
]
[Don't define __hscore_s_issock on Windows
Ian Lynagh **20080904202845]
[Unbreak the GHC build with older versions of gcc
Ian Lynagh **20080904185122
Patch from kili@outback.escape.de, who says:
Stg.h must be included before HsBase.h, because the latter contains
function definitions causing older versions of gcc (3.3.5 in my
case) to bail out with "error: global register variable follows a
function definition" on Regs.h, which is included by Stg.h.
]
[Don't make S_ISSOCK use conditional
Ian Lynagh **20080904164234
We were conditionally defining the C wrapper, but unconditionally using
it. So if it didn't exist then things would have broken anyway.
]
[Add missing files
Ian Lynagh **20080904100951]
[Remerge concurrent,unique,timeout,st,getopt into base
Ian Lynagh **20080903201908]
[remove 'pure' method from Arrow class (#2517)
Ross Paterson **20080903144436]
[make Typeable instances for larger tuples available to non-GHC
Ross Paterson **20080903113543]
[Don't look for actual OldException.Exception exceptions
Ian Lynagh **20080902224730
We don't actually throw them (we throw the new Exception equivalents
instead), and looking for them was causing an infinite loop
]
[add include/CTypes.h to extra-source-files
Ross Paterson **20080902153029]
[avoid relying on the implementation of SomeException
Ross Paterson **20080902080113
This is because Hugs uses a different implementation.
No semantic change.
]
[non-GHC: leave out Belch functions
Ross Paterson **20080831180227]
[non-GHC: add Typeable instance for ForeignPtr
Ross Paterson **20080831180048]
[docs: mention that killThread on a completed thread is a no-op
Simon Marlow **20080902093126]
[#2528: reverse the order of args to (==) in nubBy to match nub
Simon Marlow **20080902092950
This only makes a difference when the (==) definition is not
reflexive, but strictly speaking it does violate the report definition
of nubBy, so we should fix it.
]
[System.Timeout is no longer part of base
Malcolm.Wallace@cs.york.ac.uk**20080901145738]
[getopt is no longer part of base
Malcolm.Wallace@cs.york.ac.uk**20080827145336]
[Split syb off into its own package
Ian Lynagh **20080825214144
I've also moved the Data (Complex a) instance into it, and made it
portable rather than GHC-only in the process.
]
[add extra-source-files field
Ross Paterson **20080825231317]
[Fix warnings in PrelIOUtils.c
Ian Lynagh **20080825141841]
[Windows-only fixes for moving concurrent out of base
Ian Lynagh **20080824164146]
[Split off the concurrent hierarchy (concurrent, unique, timeout)
Ian Lynagh **20080824123956]
[Split getopt off into its own package
Ian Lynagh **20080824020213]
[Remove ST stuff that is now in the new st package
Ian Lynagh **20080823223014]
[Fix Windows-only warnings
Ian Lynagh **20080823002249]
[Fix Windows-only warnings in GHC.Conc
Ian Lynagh **20080822234837]
[Suppress some warnings that are hard to fix because of ifdefs
Ian Lynagh **20080822233951]
[Provide blockedOnDeadMVar, blockedIndefinitely for the RTS
Ian Lynagh **20080821110723]
[Fix more warnings
Ian Lynagh **20080820233958]
[Suppress a couple of warnings in GHC.PArr
Ian Lynagh **20080820232018
The fix isn't immediately obvious to me
]
[Fix more warnings
Ian Lynagh **20080820231937]
[Fix warnings in Data.Generics.*
Ian Lynagh **20080820230437]
[Fix some more warnings
Ian Lynagh **20080820223252]
[Ignore some orphan warnings
Ian Lynagh **20080820211901]
[remove some functions that aren't used in base
Simon Marlow **20080821142339]
[remove __hscore_renameFile, it is no longer uesd
Simon Marlow **20080818155950
System.Directory implements renameFile using unix/Win32 now.
]
[Rewrite the documentation for forkOS again
Simon Marlow **20080818132856
Try to make it clearer that forkOS is only necessary when calling
foreing libraries that use thread-local state, and it has nothing to
do with scheduling behaviour between Haskell threads. I also added
something about the performance impact of forkOS, and mentioned that
the main thread is a bound thread.
]
[nhc only: expose Foldable and Traversable instances of Array
Ross Paterson **20080817002719
These were turned off as a side-effect of a previous nhc-only fix for
#2176 that is no longer needed. They should be fine for nhc now.
]
[Fix hReady (trac #1063)
Ian Lynagh **20080816182715
We now throw an EOF exception when appropriate
]
[Fix oversight in Control.OldException
Bertram Felgenhauer **20080816132631
The NonTermination constructor slipped through in the Exception instance.
]
[Eliminate orphan rules and instances in the array package
Ian Lynagh **20080816122253]
[Control.OldException: Map exceptions to old exceptions and back properly.
Ian Lynagh **20080814210219
* Control.OldException: Map exceptions to old exceptions and back properly.
It's really necessary to map them back as well, or the RTS and base library
will not recognize exceptions that got caught and rethrown. (See #2508)
Patch from Bertram Felgenhauer
]
[add Traversable generalizations of mapAccumL and mapAccumR (#2461)
Ross Paterson **20080814162617]
[simplify definition of Prelude.catch
Ross Paterson **20080814143650]
[remove returns from void functions
Ross Paterson **20080814110841]
[No reason for Handler and catches to exclude nhc98.
Malcolm.Wallace@cs.york.ac.uk**20080813125850]
[Must import ExitCode for its instance to be re-exported.
Malcolm.Wallace@cs.york.ac.uk**20080813125710
The Cabal library depends on "instance Exception ExitCode", and expects
to import it from Control.Exception, not Control.Exception.Base.
]
[use New.catch instead of catchException in OldException
Ross Paterson **20080813071307]
[use the Haskell 98 module Control.Exception.Base in the Concurrent modules
Ross Paterson **20080813000219]
[export Control.Exception.Base
Ross Paterson **20080812233640]
[use dummy implementation of timeout for all non-GHCs
Ross Paterson **20080812151602]
[Hugs only: fix imports
Ross Paterson **20080812145654]
[non-GHC: hide Prelude.catch
Ross Paterson **20080812145622]
[add Control.Exception.Base to nhc98 build
Malcolm.Wallace@cs.york.ac.uk**20080812174300]
[bump to version 4.0
Simon Marlow **20080805153354]
[Hugs only: don't import exception types -- their instances are now in Control.Exception.Base
Ross Paterson **20080812140433]
[split most of Control.Exception into new Control.Exception.Base
Ross Paterson **20080812124912
Move everything but catches/Handler into a new internal module.
This was needed to get the new exceptions working with Hugs, because Hugs
has the constraint that all Haskell 98 library modules, and everything
they include, must be Haskell 98. This also involves a different
representation of SomeException for Hugs, so that type is exported
opaquely for Hugs. Then Control.Exception.Base is Haskell 98 as far as
Hugs is concerned, but Control.Exception needs the extensions turned on.
Control.Exception re-exports everything from Control.Exception.Base
except the functions used by the GHC runtime.
]
[remove kludges, now that Control.Exception is imported
Ross Paterson **20080811180328]
[threadDelay and friends are GHC-only
Ross Paterson **20080811175039]
[fix imports for non-GHC
Malcolm.Wallace@cs.york.ac.uk**20080808092017]
[Eq and Ord have moved into GHC.Classes
Ian Lynagh **20080807095352]
[Use the proper CInt type in GHC.Unicode
Ian Lynagh **20080806232948]
[Import wibbles
Ian Lynagh **20080806232055]
[Remove unnecessary Data/Dynamic.hs-boot
Ian Lynagh **20080806230623]
[Remove more redundant GHC.Float imports
Ian Lynagh **20080806225411]
[Remove an unnecessary import
Ian Lynagh **20080806224742]
[Move Int, Float and Double into ghc-prim:GHC.Types
Ian Lynagh **20080806191554]
[Put some explicit import lists in Data.Typeable
Ian Lynagh **20080806190353]
[Fix a couple of imports
Ian Lynagh **20080806165549]
[Remove unused conditional import
Ian Lynagh **20080806124930]
[Swap imports around to get GHC.ForeignPtr out of the base knot
Ian Lynagh **20080806121313]
[Move some bits around to stop Data.Either being in the base import knot
Ian Lynagh **20080806120504]
[Tweak an import
Ian Lynagh **20080806000440]
[Remove the DynIOError constructor of IOErrorType
Ian Lynagh **20080805234720
As far as I can see it is never used or exported
]
[Move some internals around to simplify the import graph a bit
Ian Lynagh **20080805221341]
[Move the Char datatype into ghc-prim
Ian Lynagh **20080805204009]
[Remove an unnecessary import
Ian Lynagh **20080805182336]
[The [] definition has moved to ghc-prim
Ian Lynagh **20080805182332]
[Fix warnings
Ian Lynagh **20080805150250]
[Add a missing case to Show AsyncException
Ian Lynagh **20080805142811]
[Remove GHC.Dotnet
Ian Lynagh **20080804215840]
[Hide standalone deriving clauses from haddock
Ian Lynagh **20080804211617]
[Control.Exception doesn't need to export assertError
Ian Lynagh **20080804161838]
[Generalise the type of mapException; pointed out by Isaac Dupree
Ian Lynagh **20080804160941]
[Remove some unnecessary Data.Tuple imports
Ian Lynagh **20080804155956]
[The tuple datatype definitions have moved to ghc-prim
Ian Lynagh **20080804155420]
[make ExitCode an instance of Exception for nhc98
Malcolm.Wallace@cs.york.ac.uk**20080805160330]
[poke and peek come from Foreign.Storable
Malcolm.Wallace@cs.york.ac.uk**20080804160616]
[zipWithM_ comes from Control.Monad
Malcolm.Wallace@cs.york.ac.uk**20080804160319]
[Fix nhc98 code variations to use the extensible exception API.
Malcolm.Wallace@cs.york.ac.uk**20080804155842
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.
]
[nhc98 needs the Prelude for this module
Malcolm.Wallace@cs.york.ac.uk**20080804133853]
[Change some imports and derive Show (Either a b)
Ian Lynagh **20080804004147
rather than writing it by hand in GHC.Show
]
[Windows fixes
Ian Lynagh **20080803180345]
[Remove the duplicate definition of throwTo in Control.Exception
Ian Lynagh **20080803141703
It now imports GHC.Conc, so it is no longer necessary
]
[Remove the only import of GHC.Exts
Ian Lynagh **20080803141944]
[Move assertError into GHC.IOBase
Ian Lynagh **20080803141040]
[Use onException rather than catchAny
Ian Lynagh **20080803114104]
[Generalise the type of onException
Ian Lynagh **20080803003001
The type of the thing to do on an exception is now
IO b
rather than
IO ()
which better matches functions like bracket.
]
[Remove the dangerous Exception functions
Ian Lynagh **20080802231358
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.
]
[Remove an unused import
Ian Lynagh **20080801230343]
[Remove unused imports
Ian Lynagh **20080801230059]
[Remove unused imports in Control.Exception
Ian Lynagh **20080801225847]
[Get rid of some duplicate imports
Ian Lynagh **20080801214933]
[Remove the now-unused GHC/Conc.lhs-boot
Ian Lynagh **20080801214707]
[Make some more imports non-recursive
Ian Lynagh **20080801214546]
[Rejig some code so Control.Exception and GHC.Conc don't need recursive imports
Ian Lynagh **20080801214208]
[Remove the now-unused GHC/TopHandler.lhs-boot
Ian Lynagh **20080801212105]
[Reshuffle GHC.Conc/GHC.TopHandler a bit to remove a recursive import
Ian Lynagh **20080801211801]
[Don't import Control.Concurrent.MVar in GHC.TopHandler
Ian Lynagh **20080801200123]
[Export assertError from Control.Exception to make GHC happy
Ian Lynagh **20080801111716
It's a wired-in name in GHC. We should possibly move it to another module.
]
[TopHandler now uses the new extensible exceptions
Ian Lynagh **20080731153553]
[Comment wibble
Ian Lynagh **20080730202127]
[Make numericEnumFrom more efficient
Ian Lynagh **20080730202049]
[Put in some parens to clarify how things parse
Ian Lynagh **20080730201934]
[applied patches to make enumFrom and friends strict in arguments as per the Report; closes ticket #1997
Bart Massey **20080726080444]
[Don't use "deriving Typeable" (for portability reasons)
Ian Lynagh **20080730194434]
[Add onException
Ian Lynagh **20080730172014]
[Fix whitespace
Ian Lynagh **20080730171951
The space after "\begin{code}" was confusing haddock
]
[Re-add blocked; it got lost in the extensible exceptions patches
Ian Lynagh **20080730145614]
[Start to actually use extensible exceptions
Ian Lynagh **20080730145115]
[Rejig the extensible exceptions so there is less circular importing
Ian Lynagh **20080730122539]
[Define nonTermination for the RTS to use
Ian Lynagh **20080621144420
We'll probably need to do the same for some other exceptions too
]
[Use extensible exceptions at the lowest level
Ian Lynagh **20080621121501
Everything above is largely unchanged; just the type of catch and throw.
]
[add comment
Simon Marlow **20080730114559]
[add some big warnings to the docs for unsafeIOToSTM (#2401)
Simon Marlow **20080730114554]
[FIX #2376: inline shiftR
Simon Marlow **20080730103539
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.
]
[Add instance Show Control.Exception.Exception for nhc98.
Malcolm.Wallace@cs.york.ac.uk**20080728164537]
[Extend nhc98's Exception type to resemble ghc's more closely
Malcolm.Wallace@cs.york.ac.uk**20080728163445]
[fix dummy async implementations for non-GHC
Ross Paterson **20080715125521]
[Fix haddocking with older haddocks
Ian Lynagh **20080710190855]
[Add threadStatus :: ThreadId -> IO ThreadStatus
Simon Marlow **20080710151711
-- | 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.
]
[forkOS: start the new thread in blocked mode iff the parent was (#1048)
Simon Marlow **20080709135558
This matches the behaviour of forkIO
]
[Add Control.Exception.blocked :: IO Bool
Simon Marlow **20080709133139
Tells you whether async exceptions are currently blocked or not.
]
[FIX BUILD (on Windows)
Simon Marlow **20080709123110]
[check CONST_SIGINT
Simon Marlow **20080709122527]
[Make threadWaitRead/threadWaitWrite partially useable on Windows
Simon Marlow **20080709111008
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)").
]
[FIX #1198: hWaitForInput on Windows
Simon Marlow **20080708134254
Now we do the appropriate magic in fdReady() to detect when there is
real input available, as opposed to uninteresting console events.
]
[FIX part of #2301
Simon Marlow **20080709094437
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.
]
[() has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple
Ian Lynagh **20080624144932]
[Add GHC.Exts.maxTupleSize :: Int, the size of the largest tuple supported
Ian Lynagh **20080622141559]
[Remove code for older GHC versions
Ian Lynagh **20080620194521]
[Make the macros in Typeable.h add type signatures
Ian Lynagh **20080619235808]
[Fix #2363: getChar cannot be interrupted with -threaded
Simon Marlow **20080619141911
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).
]
[Remove -fglasgow-exts from pragmas and comments
Ian Lynagh **20080616230727]
[Avoid using deprecated flags
Ian Lynagh **20080616145207]
[delete __hscore_{mkstemp,getrlimit,setrlimit} (moved to unix)
Ross Paterson **20080615224413]
[Update WCsubst.c for Unicode 5.1.0, and add a README.Unicode
Ian Lynagh **20080613201754
README.Unicode describes how to do updates in the future.
]
[Fix ubconfc
Ian Lynagh **20080613201456
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.
]
['permutations' is now more lazy and also faster
Twan van Laarhoven **20080102231712]
['subsequences' is now more lazy and also faster
Twan van Laarhoven **20080102231629]
[Add 'subsequences' and 'permutations' to Data.List
Twan van Laarhoven **20071218154950]
[Tweak the definition of (^) again
Ian Lynagh **20080601120759
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.
]
[note about evaluation affecting StableNames
Simon Marlow **20080527110549]
[TAG 2008-05-28
Ian Lynagh **20080528003830]
Patch bundle hash:
362d7dbec0cf62326711b0fedad76fb3fc05a2bf