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.
Simon Marlow [Mon, 13 Jul 2009 11:31:04 +0000 (11:31 +0000)]
Export Unicode and newline functionality from System.IO; update Haddock docs
Simon Marlow [Tue, 7 Jul 2009 12:44:06 +0000 (12:44 +0000)]
add a comment about the non-workingness of CHARBUF_UTF16
Ian Lynagh [Sat, 11 Jul 2009 00:43:51 +0000 (00:43 +0000)]
Fix build on Windows
Ian Lynagh [Fri, 10 Jul 2009 20:45:13 +0000 (20:45 +0000)]
Fix some "warn-unused-do-bind" warnings where we want to ignore the value
Ian Lynagh [Fri, 10 Jul 2009 20:42:21 +0000 (20:42 +0000)]
Use throwErrnoIfMinus1_ when calling getrusage
Ian Lynagh [Fri, 10 Jul 2009 15:33:45 +0000 (15:33 +0000)]
Remove an unused import
Ian Lynagh [Fri, 10 Jul 2009 15:32:57 +0000 (15:32 +0000)]
reportStackOverflow now returns IO ()
It used to do "return undefined" to return IO a.
Ian Lynagh [Fri, 10 Jul 2009 15:26:46 +0000 (15:26 +0000)]
GHC.Conc.reportError now returns IO ()
It used to return IO a, by "return undefined".
Ian Lynagh [Fri, 10 Jul 2009 15:25:26 +0000 (15:25 +0000)]
Fix some "warn-unused-do-bind" warnings where we want to ignore the value
Ian Lynagh [Fri, 10 Jul 2009 15:14:38 +0000 (15:14 +0000)]
Minor SampleVar refactoring
Ian Lynagh [Fri, 10 Jul 2009 12:29:05 +0000 (12:29 +0000)]
Fix "warn-unused-do-bind" warnings in GHC/IO/Handle/Text.hs
Ian Lynagh [Fri, 10 Jul 2009 00:56:38 +0000 (00:56 +0000)]
Fix some "warn-unused-do-bind" warnings where we just want to ignore the result
Ian Lynagh [Fri, 10 Jul 2009 00:40:32 +0000 (00:40 +0000)]
Use the result of writeCharBuf in GHC/IO/Encoding/Latin1.hs too
Ian Lynagh [Fri, 10 Jul 2009 00:38:01 +0000 (00:38 +0000)]
Minor code tidyups in GHC.Conc
Ian Lynagh [Fri, 10 Jul 2009 00:35:30 +0000 (00:35 +0000)]
Fix "warn-unused-do-bind" warning in GHC.Conc
If we fail to communicate with the IO manager then we print a warning
using debugErrLn from the ghc-prim package.
Ian Lynagh [Thu, 9 Jul 2009 16:45:46 +0000 (16:45 +0000)]
Fix "warn-unused-do-bind" warnings in System.Posix.Internals
Ian Lynagh [Thu, 9 Jul 2009 16:39:12 +0000 (16:39 +0000)]
Fix "warn-unused-do-bind" warnings where we really do want to ignore the result
Ian Lynagh [Tue, 7 Jul 2009 18:19:24 +0000 (18:19 +0000)]
Add back imports needed on Windows
Ian Lynagh [Tue, 7 Jul 2009 11:58:10 +0000 (11:58 +0000)]
Remove unused imports
simonpj@microsoft.com [Mon, 6 Jul 2009 11:18:42 +0000 (11:18 +0000)]
Remove unused imports from base
These unused imports are detected by the new unused-import code
Simon Marlow [Mon, 6 Jul 2009 13:33:03 +0000 (13:33 +0000)]
Use the result of writeCharBuf
This only makes a difference when CHARBUF_UTF16 is in use, which it
normally isn't. I suspect CHARBUF_UTF16 doesn't currently work for
other reasons (CHARBUF_UTF16 was an experiment before I wrote the
GHC.IO.Encoding.UTF* codecs), but this patch at least makes it
slightly closer to working.
Ian Lynagh [Mon, 6 Jul 2009 18:16:30 +0000 (18:16 +0000)]
Remove some cruft from Data.HashTable
simonpj@microsoft.com [Mon, 6 Jul 2009 11:18:01 +0000 (11:18 +0000)]
Add 'eof' to Text.ParserCombinators.ReadP
Add a ReadP parser that succeeds at the end of input. Very useful!
Ian Lynagh [Sun, 5 Jul 2009 15:51:20 +0000 (15:51 +0000)]
Don't export CLDouble for GHC; fixes trac #2793
We never really supported CLDouble (it was a plain old double underneath),
and pretending that we do does more harm than good.
Simon Marlow [Thu, 2 Jul 2009 08:14:15 +0000 (08:14 +0000)]
a byte between 0x80 and 0xBF is illegal immediately (#3341)
Simon Marlow [Tue, 30 Jun 2009 08:41:34 +0000 (08:41 +0000)]
avoid a warning
Matthias Kilian [Mon, 29 Jun 2009 18:36:34 +0000 (18:36 +0000)]
Add a wrapper for libiconv.
Simon Marlow [Mon, 29 Jun 2009 08:53:51 +0000 (08:53 +0000)]
#include <sys/times.h> if we have it (should fix build problems)
Simon Marlow [Fri, 26 Jun 2009 12:05:22 +0000 (12:05 +0000)]
set binary mode for existing FDs on Windows (fixes some GHCi test failures)
Simon Marlow [Thu, 25 Jun 2009 12:03:25 +0000 (12:03 +0000)]
Move directory-related stuff to the unix package
now that it isn't used on Windows any more.
Simon Marlow [Thu, 25 Jun 2009 15:25:27 +0000 (15:25 +0000)]
fix the windows build even more
Simon Marlow [Thu, 25 Jun 2009 11:58:04 +0000 (11:58 +0000)]
not having iconv is not fatal on Windows
Simon Marlow [Thu, 25 Jun 2009 09:46:09 +0000 (09:46 +0000)]
fix build failure on Windows
Ian Lynagh [Wed, 24 Jun 2009 12:54:22 +0000 (12:54 +0000)]
Fix iconv detection on OpenBSD
Matthias Kilian discovered that iconv_open is #define'd to something
else on OpenBSD, so the test needs to include the iconv header.
Simon Marlow [Wed, 24 Jun 2009 11:50:29 +0000 (11:50 +0000)]
setNonBlockingMode now takes a flag, can turn blocking mode back on again
Simon Marlow [Tue, 23 Jun 2009 14:38:13 +0000 (14:38 +0000)]
Call nl_langinfo(CODESET) to get the name of the locale encoding on Unix
Simon Marlow [Tue, 23 Jun 2009 13:38:18 +0000 (13:38 +0000)]
add hFlushAll, flushes both read and write buffers
Simon Marlow [Tue, 23 Jun 2009 10:50:04 +0000 (10:50 +0000)]
fix bug in partial writes
Simon Marlow [Mon, 22 Jun 2009 09:26:56 +0000 (09:26 +0000)]
Tidy up use of read/write/recv/send; avoid unnecessary wrappers
Simon Marlow [Mon, 22 Jun 2009 08:39:57 +0000 (08:39 +0000)]
Make this file independent of HsBase.h, use HsBaseConfig.h only
Simon Marlow [Thu, 18 Jun 2009 13:54:58 +0000 (13:54 +0000)]
Windows: Unicode openFile and stat functions
Simon Marlow [Thu, 18 Jun 2009 11:26:16 +0000 (11:26 +0000)]
Add a comment to remind us that memcpy_src_off is used by dph
Ian Lynagh [Sat, 20 Jun 2009 20:48:09 +0000 (20:48 +0000)]
Unconditionally make a (Show Ptr) instance
It used to only exist if (WORD_SIZE_IN_BITS == 32 || WORD_SIZE_IN_BITS == 64)
Ian Lynagh [Mon, 15 Jun 2009 20:32:40 +0000 (20:32 +0000)]
Remove AC_C_CONST
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.
Ian Lynagh [Mon, 15 Jun 2009 20:24:44 +0000 (20:24 +0000)]
Remove old Integer prototypes
Duncan Coutts [Fri, 12 Jun 2009 14:29:51 +0000 (14:29 +0000)]
Redefine gcdInt to use gcdInteger rather than gcdInt# primop
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.
Ian Lynagh [Sat, 20 Jun 2009 15:52:08 +0000 (15:52 +0000)]
The IO type has moved to GHC.Types in ghc-prim
Ian Lynagh [Mon, 15 Jun 2009 21:48:50 +0000 (21:48 +0000)]
Fix warnings in configure script
Ian Lynagh [Mon, 15 Jun 2009 20:16:34 +0000 (20:16 +0000)]
Fix warnings in C programs generated by configure; fixes failures with -Werror
Simon Marlow [Sun, 14 Jun 2009 18:53:32 +0000 (18:53 +0000)]
Save and restore the codec state when re-decoding
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.
Simon Marlow [Tue, 16 Jun 2009 11:07:55 +0000 (11:07 +0000)]
Fix #3128: file descriptor leak when hClose fails
Malcolm.Wallace@cs.york.ac.uk [Mon, 15 Jun 2009 15:52:49 +0000 (15:52 +0000)]
Allow System.Posix.Internals to compile with nhc98 again.
Also affects GHC.IO.Device, which is not very GHC-specific at all.
Ian Lynagh [Fri, 12 Jun 2009 23:13:07 +0000 (23:13 +0000)]
Add iconv as an extra library on platform that need to link with it
For example, we need -liconv on OS X.
Simon Marlow [Fri, 12 Jun 2009 13:56:31 +0000 (13:56 +0000)]
Rewrite of the IO library, including Unicode support
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.
Duncan Coutts [Thu, 11 Jun 2009 16:01:00 +0000 (16:01 +0000)]
Remove unused foreign imports of __encodeFloat/Double
Malcolm.Wallace@cs.york.ac.uk [Fri, 5 Jun 2009 09:17:30 +0000 (09:17 +0000)]
nhc98 must build dirUtils.c as well.
Fixes this bootstrapping error:
Undefined symbols:
"___hscore_readdir", referenced from:
_FR_System_46Posix_46Internals_46readdir_35 in libHSbase.a(Internals.o)
Ian Lynagh [Tue, 2 Jun 2009 18:36:08 +0000 (18:36 +0000)]
Remove unnecessary parens
Simon Marlow [Fri, 29 May 2009 13:02:14 +0000 (13:02 +0000)]
Fix validate (on Windows)
simonpj@microsoft.com [Fri, 29 May 2009 08:35:49 +0000 (08:35 +0000)]
Make two type defaults explicit
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) +
Simon Marlow [Thu, 28 May 2009 12:37:38 +0000 (12:37 +0000)]
Fix #3257: document that exitWith in a forkIO'd thread does not exit the process
Ian Lynagh [Sun, 24 May 2009 15:56:10 +0000 (15:56 +0000)]
Increase the version number to that in the 6.10 branch
Ian Lynagh [Sat, 23 May 2009 22:45:08 +0000 (22:45 +0000)]
Fix warnings
Ian Lynagh [Sat, 23 May 2009 20:02:38 +0000 (20:02 +0000)]
Document that the initial quantity for QSem and QSemN must be >= 0
Simon Marlow [Wed, 20 May 2009 13:09:26 +0000 (13:09 +0000)]
add _O_NOINHERIT when opening files on Windows (see #2650)