ghc-base.git
13 years agoexport allocaBytesAligned; make allocaArray use the correct alignment (#2917)
Simon Marlow [Thu, 12 Aug 2010 10:55:24 +0000 (10:55 +0000)]
export allocaBytesAligned; make allocaArray use the correct alignment (#2917)

13 years agodeprecate unGetChan and isEmptyChan (see #4154)
Simon Marlow [Mon, 5 Jul 2010 12:59:52 +0000 (12:59 +0000)]
deprecate unGetChan and isEmptyChan (see #4154)

13 years agoAdd type signatures to cope with lack of local generalisation
simonpj@microsoft.com [Wed, 28 Jul 2010 12:48:47 +0000 (12:48 +0000)]
Add type signatures to cope with lack of local generalisation

13 years agoAdd type signature in local where
simonpj@microsoft.com [Tue, 27 Jul 2010 15:15:32 +0000 (15:15 +0000)]
Add type signature in local where

13 years agoIntegrated new I/O manager
Simon Marlow [Tue, 10 Aug 2010 08:22:48 +0000 (08:22 +0000)]
Integrated new I/O manager
(patch originally by Johan Tibell <johan.tibell@gmail.com>, minor merging by me)

14 years agoAdd mfilter to Control.Monad
jon.fairbairn@cl.cam.ac.uk [Thu, 17 Sep 2009 14:56:16 +0000 (14:56 +0000)]
Add mfilter to Control.Monad

Straightforward MonadPlus version of List.filter. I would
prefer to call it filter, but the current naming scheme for
Control.Monad implies mfilter.

13 years agomove Monad and MonadFix instances for Either from mtl (proposal #4159)
Ross Paterson [Thu, 29 Jul 2010 12:24:49 +0000 (12:24 +0000)]
move Monad and MonadFix instances for Either from mtl (proposal #4159)

The Monad and MonadFix instances for Either (formerly in the mtl
package) are moved to Control.Monad.Instances and Control.Monad.Fix
respectively.  The Monad instance is still an orphan, to retain Haskell
98 compatibility, but the MonadFix instance is together with its class.
The Error constraint is removed from both instances, and the default
definition of fail is used.

13 years agoRemove egregious ghc-ish from Foreign.Marshal
Malcolm.Wallace@me.com [Thu, 22 Jul 2010 07:54:49 +0000 (07:54 +0000)]
Remove egregious ghc-ish from Foreign.Marshal

13 years agoadd numSparks :: IO Int (#4167)
Simon Marlow [Tue, 20 Jul 2010 15:38:58 +0000 (15:38 +0000)]
add numSparks :: IO Int (#4167)

13 years agoadd unsafeLocalState from Haskell 2010, and docs
Simon Marlow [Tue, 20 Jul 2010 08:28:19 +0000 (08:28 +0000)]
add unsafeLocalState from Haskell 2010, and docs

13 years agodocs: mention that Foreign.unsafePerformIO is deprecated
Simon Marlow [Tue, 20 Jul 2010 08:28:04 +0000 (08:28 +0000)]
docs: mention that Foreign.unsafePerformIO is deprecated
We can't actually deprecate it without introducing a name clash
between Foreign.unsafePerformIO and System.IO.Unsafe.unsafePerformIO

13 years agodoc formatting fix
Simon Marlow [Wed, 14 Jul 2010 15:13:47 +0000 (15:13 +0000)]
doc formatting fix

13 years agoadd module intro from Haskell 2010
Simon Marlow [Wed, 14 Jul 2010 11:58:53 +0000 (11:58 +0000)]
add module intro from Haskell 2010

13 years agodocument exception-overriding behaviour in withFile
Simon Marlow [Wed, 14 Jul 2010 10:41:07 +0000 (10:41 +0000)]
document exception-overriding behaviour in withFile

13 years agodoc: use "finalizer" consistently
Simon Marlow [Wed, 14 Jul 2010 10:36:49 +0000 (10:36 +0000)]
doc: use "finalizer" consistently

13 years agoclarify meaning of bit
Simon Marlow [Wed, 14 Jul 2010 10:33:10 +0000 (10:33 +0000)]
clarify meaning of bit

13 years agonote shortcutting behaviour of any/all/elem
Simon Marlow [Wed, 14 Jul 2010 10:33:04 +0000 (10:33 +0000)]
note shortcutting behaviour of any/all/elem

13 years agoadd cast{C,U}CharToChar and castCharTo{C,U}Char, from Haskell 2010
Simon Marlow [Tue, 13 Jul 2010 13:25:15 +0000 (13:25 +0000)]
add cast{C,U}CharToChar and castCharTo{C,U}Char, from Haskell 2010

13 years agomention that IntPtr and WordPtr can be marshalled to/from intptr_t and uintptr_t
Simon Marlow [Tue, 13 Jul 2010 13:24:03 +0000 (13:24 +0000)]
mention that IntPtr and WordPtr can be marshalled to/from intptr_t and uintptr_t

13 years agoPartial fix for Trac #4136
simonpj@microsoft.com [Wed, 7 Jul 2010 13:57:25 +0000 (13:57 +0000)]
Partial fix for Trac #4136

In 'choose' (which is a library function designed specifically
to support derived instances of Read), we must match Symbol
as well as Ident, for nullary constructors that (wierdly) are
symbols.

13 years agoFix typo in documentation
Simon Hengel [Sun, 11 Jul 2010 14:16:48 +0000 (14:16 +0000)]
Fix typo in documentation

13 years agoRemove duplicated word in documentation
Simon Hengel [Sun, 11 Jul 2010 07:27:03 +0000 (07:27 +0000)]
Remove duplicated word in documentation

13 years agoAllow nhc98 to cope with recent changes to Control.Exception.
Malcolm.Wallace@me.com [Sat, 10 Jul 2010 17:09:40 +0000 (17:09 +0000)]
Allow nhc98 to cope with recent changes to Control.Exception.

13 years ago New asynchronous exception control API (base parts)
Simon Marlow [Thu, 8 Jul 2010 15:27:35 +0000 (15:27 +0000)]
 New asynchronous exception control API (base parts)

As discussed on the libraries/haskell-cafe mailing lists
  http://www.haskell.org/pipermail/libraries/2010-April/013420.html

This is a replacement for block/unblock in the asychronous exceptions
API to fix a problem whereby a function could unblock asynchronous
exceptions even if called within a blocked context.

The new terminology is "mask" rather than "block" (to avoid confusion
due to overloaded meanings of the latter).

The following is the new API; the old API is deprecated but still
available for the time being.

Control.Exception
-----------------

mask  :: ((forall a. IO a -> IO a) -> IO b) -> IO b
mask_ :: IO a -> IO a

uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
uninterruptibleMask_ :: IO a -> IO

getMaskingState :: IO MaskingState

data MaskingState
  = Unmasked
  | MaskedInterruptible
  | MaskedUninterruptible

Control.Concurrent
------------------

forkIOUnmasked :: IO () -> IO ThreadId

13 years agoAsync-exception safety, and avoid space leaks
Simon Marlow [Thu, 8 Jul 2010 14:58:19 +0000 (14:58 +0000)]
Async-exception safety, and avoid space leaks
Patch submitted by: Bas van Dijk <v.dijk.bas@gmail.com>
Modified slightly by me to remove non-functional changes.

13 years agoAsync-exception safety, and avoid space leaks
Simon Marlow [Thu, 8 Jul 2010 10:31:54 +0000 (10:31 +0000)]
Async-exception safety, and avoid space leaks
Patch submitted by: Bas van Dijk <v.dijk.bas@gmail.com>
Modified slightly by me to remove non-functional changes.

13 years agoFix a few places where we forgot to close the text codecs (#4029)
Simon Marlow [Fri, 2 Jul 2010 13:02:10 +0000 (13:02 +0000)]
Fix a few places where we forgot to close the text codecs (#4029)
Each time you invoke :load in GHCi it resets the CAFs, including
stdin/stdout/stderr, and each of these was allocating a new iconv_t.

13 years agoremove docs from Monad that belonged on the instance for MonadPlus IO
Simon Marlow [Thu, 1 Jul 2010 15:42:03 +0000 (15:42 +0000)]
remove docs from Monad that belonged on the instance for MonadPlus IO

13 years agodocs: unqualify Prelude.IO
Simon Marlow [Thu, 1 Jul 2010 15:38:17 +0000 (15:38 +0000)]
docs: unqualify Prelude.IO

13 years agounqualify Float and Double
Simon Marlow [Thu, 1 Jul 2010 14:27:27 +0000 (14:27 +0000)]
unqualify Float and Double

13 years agoextract information about Data.Time from docs for CTime
Simon Marlow [Thu, 1 Jul 2010 14:24:15 +0000 (14:24 +0000)]
extract information about Data.Time from docs for CTime

13 years agodoc typo
Simon Marlow [Thu, 1 Jul 2010 14:23:54 +0000 (14:23 +0000)]
doc typo

13 years agopeekArray docs: remove mentions of "this version" and "previous version"
Simon Marlow [Thu, 1 Jul 2010 12:53:33 +0000 (12:53 +0000)]
peekArray docs: remove mentions of "this version" and "previous version"

13 years agodoc typo
Simon Marlow [Thu, 1 Jul 2010 12:41:54 +0000 (12:41 +0000)]
doc typo

13 years agodoc typo
Simon Marlow [Thu, 1 Jul 2010 12:41:28 +0000 (12:41 +0000)]
doc typo

13 years agodoc typo
Simon Marlow [Thu, 1 Jul 2010 12:37:15 +0000 (12:37 +0000)]
doc typo

13 years agodoc wibble: Haskell 98 I/O Error -> 'IOError'
Simon Marlow [Thu, 1 Jul 2010 12:36:12 +0000 (12:36 +0000)]
doc wibble: Haskell 98 I/O Error -> 'IOError'

13 years agodoc typo
Simon Marlow [Thu, 1 Jul 2010 12:30:14 +0000 (12:30 +0000)]
doc typo

13 years agoHaddock hacks to fix whitespace consistency
Simon Marlow [Thu, 1 Jul 2010 12:16:31 +0000 (12:16 +0000)]
Haddock hacks to fix whitespace consistency

13 years agouse '==' consistently rather than '->' in examples
Simon Marlow [Thu, 1 Jul 2010 12:16:16 +0000 (12:16 +0000)]
use '==' consistently rather than '->' in examples

13 years agodoc wibble: remove confusing mention of "Prelude"
Simon Marlow [Thu, 1 Jul 2010 11:33:08 +0000 (11:33 +0000)]
doc wibble: remove confusing mention of "Prelude"

13 years agodoc wibble: nonstrict -> non-strict
Simon Marlow [Thu, 1 Jul 2010 11:32:53 +0000 (11:32 +0000)]
doc wibble: nonstrict -> non-strict

13 years agodoc whitespace
Simon Marlow [Thu, 1 Jul 2010 11:22:42 +0000 (11:22 +0000)]
doc whitespace

13 years agomove the doc for 'Char' to its new home in ghc-prim:GHC.Types
Simon Marlow [Tue, 29 Jun 2010 13:41:50 +0000 (13:41 +0000)]
move the doc for 'Char' to its new home in ghc-prim:GHC.Types

13 years agodoc wibble
Simon Marlow [Tue, 29 Jun 2010 12:26:08 +0000 (12:26 +0000)]
doc wibble

13 years agodoc updates in System.IO
Simon Marlow [Tue, 29 Jun 2010 12:21:18 +0000 (12:21 +0000)]
doc updates in System.IO

13 years agodoc wibble
Simon Marlow [Fri, 25 Jun 2010 13:48:58 +0000 (13:48 +0000)]
doc wibble

13 years agodoc wibbles
Simon Marlow [Thu, 24 Jun 2010 15:46:14 +0000 (15:46 +0000)]
doc wibbles

13 years agoFix haddock formatting
Ian Lynagh [Fri, 25 Jun 2010 22:26:23 +0000 (22:26 +0000)]
Fix haddock formatting

13 years agoGive nub's complexity in the haddock docs; fixes #4086
Ian Lynagh [Fri, 25 Jun 2010 22:20:59 +0000 (22:20 +0000)]
Give nub's complexity in the haddock docs; fixes #4086

13 years agocorrect docs for exitWith: only stdout/stderr are flushed, not all Handles
Simon Marlow [Thu, 24 Jun 2010 13:05:06 +0000 (13:05 +0000)]
correct docs for exitWith: only stdout/stderr are flushed, not all Handles

13 years agofix docs for isSpace
Simon Marlow [Thu, 24 Jun 2010 13:04:44 +0000 (13:04 +0000)]
fix docs for isSpace

13 years agomake the hGetBuf/hPutBuf family work with non-FD Handles (#4144)
Simon Marlow [Thu, 24 Jun 2010 13:04:25 +0000 (13:04 +0000)]
make the hGetBuf/hPutBuf family work with non-FD Handles (#4144)

13 years agonit in docs for accumArray
Simon Marlow [Tue, 22 Jun 2010 12:11:31 +0000 (12:11 +0000)]
nit in docs for accumArray

13 years agoadd doc for the ExitCode type
Simon Marlow [Tue, 22 Jun 2010 12:09:30 +0000 (12:09 +0000)]
add doc for the ExitCode type

13 years agoremove extraneous info from docs for Array
Simon Marlow [Tue, 22 Jun 2010 12:09:21 +0000 (12:09 +0000)]
remove extraneous info from docs for Array

13 years agoadd an INLINE to the list version of traverse, to enable fusion
Simon Marlow [Tue, 8 Jun 2010 08:25:31 +0000 (08:25 +0000)]
add an INLINE to the list version of traverse, to enable fusion

13 years agoDon't define the C localeEncoding on Windows
Ian Lynagh [Sun, 20 Jun 2010 20:23:42 +0000 (20:23 +0000)]
Don't define the C localeEncoding on Windows
(it causes warnings, and isn't used)

13 years agoadd Applicative instance for Either (proposal #4095)
Ross Paterson [Thu, 17 Jun 2010 22:51:10 +0000 (22:51 +0000)]
add Applicative instance for Either (proposal #4095)

This is not the only possible instance for Either, but this one is
compatible with the usual Monad instance.

13 years agoUse libcharset instead of nl_langinfo(CODESET) if possible.
pho@cielonegro.org [Wed, 19 May 2010 01:31:12 +0000 (01:31 +0000)]
Use libcharset instead of nl_langinfo(CODESET) if possible.

nl_langinfo(CODESET) doesn't always return standardized variations of the encoding names. Use libcharset if possible, which is shipped together with GNU libiconv.

13 years agoAdd a note about the interruptibility of throwTo.
Simon Marlow [Tue, 15 Jun 2010 11:27:20 +0000 (11:27 +0000)]
Add a note about the interruptibility of throwTo.

13 years agodocs: note that hGetBufNonBlocking isn't non-blocking on Windows
Simon Marlow [Tue, 15 Jun 2010 11:25:47 +0000 (11:25 +0000)]
docs: note that hGetBufNonBlocking isn't non-blocking on Windows

13 years agodon't depend on Prelude (#4122)
Simon Marlow [Tue, 15 Jun 2010 10:56:31 +0000 (10:56 +0000)]
don't depend on Prelude (#4122)

13 years agoDon't depend on Prelude (#4123)
Simon Marlow [Tue, 15 Jun 2010 10:54:01 +0000 (10:54 +0000)]
Don't depend on Prelude (#4123)

13 years agobump version to 4.3.0.0, added instance MonadPlus STM
Simon Marlow [Tue, 1 Jun 2010 14:48:31 +0000 (14:48 +0000)]
bump version to 4.3.0.0, added instance MonadPlus STM

13 years agoMoved MonadPlus instance for STM from Control.Monad.STM to GHC.Conc to avoid an orpha...
Bas van Dijk [Sun, 16 May 2010 16:06:51 +0000 (16:06 +0000)]
Moved MonadPlus instance for STM from Control.Monad.STM to GHC.Conc to avoid an orphaned instance

13 years agoAdded Applicative and Alternative instances for STM
Bas van Dijk [Sun, 16 May 2010 17:17:56 +0000 (17:17 +0000)]
Added Applicative and Alternative instances for STM

13 years agoexpand Foldable instance for Array
Ross Paterson [Wed, 2 Jun 2010 21:21:54 +0000 (21:21 +0000)]
expand Foldable instance for Array

13 years agodoc comment illustrating Foldable(foldr)
Ross Paterson [Thu, 27 May 2010 15:08:33 +0000 (15:08 +0000)]
doc comment illustrating Foldable(foldr)

13 years agofix syntax in doc comments
Ross Paterson [Thu, 27 May 2010 15:07:57 +0000 (15:07 +0000)]
fix syntax in doc comments

13 years agoexport hGetBufSome (#4046)
Simon Marlow [Thu, 20 May 2010 09:35:38 +0000 (09:35 +0000)]
export hGetBufSome (#4046)

13 years agohWaitForInput: don't try to read from the device (#4078)
Simon Marlow [Mon, 17 May 2010 13:37:41 +0000 (13:37 +0000)]
hWaitForInput: don't try to read from the device (#4078)
readTextDeviceNonBlocking is not non-blocking on Windows

14 years agohSetEncoding: change the encoding on both read and write sides (#4066)
Simon Marlow [Fri, 14 May 2010 12:46:28 +0000 (12:46 +0000)]
hSetEncoding: change the encoding on both read and write sides (#4066)

14 years agoCorrect haddock formatting.
Adam Vogt [Fri, 23 Apr 2010 02:21:03 +0000 (02:21 +0000)]
Correct haddock formatting.

14 years agoFix for hGetBufSome
Simon Marlow [Wed, 5 May 2010 13:56:37 +0000 (13:56 +0000)]
Fix for hGetBufSome

14 years agoimprove the documentation for throwTo and killThread (#3884)
Simon Marlow [Wed, 5 May 2010 13:56:00 +0000 (13:56 +0000)]
improve the documentation for throwTo and killThread (#3884)

14 years agoelaborate the docs for unsafePerformIO a bit
Simon Marlow [Wed, 5 May 2010 10:12:49 +0000 (10:12 +0000)]
elaborate the docs for unsafePerformIO a bit

14 years agoadd Typeable instance
Simon Marlow [Tue, 4 May 2010 15:28:15 +0000 (15:28 +0000)]
add Typeable instance

14 years agoAdd hGetBufSome, like hGetBuf but can return short reads
Simon Marlow [Tue, 4 May 2010 15:27:59 +0000 (15:27 +0000)]
Add hGetBufSome, like hGetBuf but can return short reads

14 years agoAdd swap (#3298)
Simon Marlow [Tue, 4 May 2010 09:53:39 +0000 (09:53 +0000)]
Add swap (#3298)

14 years agoinline allocaArray0, to fix withCString benchmark
Simon Marlow [Fri, 23 Apr 2010 12:47:29 +0000 (12:47 +0000)]
inline allocaArray0, to fix withCString benchmark

14 years agoraise asynchronous exceptions asynchronously (#3997)
Simon Marlow [Wed, 21 Apr 2010 09:49:32 +0000 (09:49 +0000)]
raise asynchronous exceptions asynchronously (#3997)

14 years agoadd NOINLINE pragmas for stdin/stdout/stderr
Simon Marlow [Wed, 21 Apr 2010 08:20:41 +0000 (08:20 +0000)]
add NOINLINE pragmas for stdin/stdout/stderr

14 years agoINLINE alloca and malloc
Simon Marlow [Mon, 19 Apr 2010 13:53:33 +0000 (13:53 +0000)]
INLINE alloca and malloc
See discussion on glasgow-haskell-users:
  http://www.haskell.org/pipermail/glasgow-haskell-users/2010-April/018740.html

14 years agoMove comment closer to the offending line
Matthias Kilian [Mon, 19 Apr 2010 15:54:21 +0000 (15:54 +0000)]
Move comment closer to the offending line

14 years agoIgnore the return code of c_fcntl_write again
Matthias Kilian [Thu, 15 Apr 2010 14:04:52 +0000 (14:04 +0000)]
Ignore the return code of c_fcntl_write again

The return code has been ignored in the past on purpose, because
O_NONBLOCK will fail on BSDs for some special files. This fixes the
problem mentioned in
http://www.haskell.org/pipermail/glasgow-haskell-users/2010-April/018698.html

14 years agoFix bitrot in IO debugging code
Ian Lynagh [Tue, 13 Apr 2010 13:43:39 +0000 (13:43 +0000)]
Fix bitrot in IO debugging code
Also switched to using Haskell Bools (rather than CPP) to en/disable it,
so it shouldn't break again in the future.

14 years agoTiny code tidy-up
Ian Lynagh [Tue, 13 Apr 2010 01:11:47 +0000 (01:11 +0000)]
Tiny code tidy-up

14 years agoremove old/wrong comment
Simon Marlow [Thu, 25 Mar 2010 16:14:03 +0000 (16:14 +0000)]
remove old/wrong comment

14 years agowithThread: block asynchronous exceptions before installing exception handler.
Bas van Dijk [Mon, 29 Mar 2010 13:16:24 +0000 (13:16 +0000)]
withThread: block asynchronous exceptions before installing exception handler.
Note that I don't unblock the given io computation. Because AFAICS
withThread is only called with 'waitFd' which only performs an FFI
call which can't receive asynchronous exceptions anyway.

14 years agorunInUnboundThread: block asynchronous exceptions before installing exception handler
Bas van Dijk [Mon, 29 Mar 2010 13:15:49 +0000 (13:15 +0000)]
runInUnboundThread: block asynchronous exceptions before installing exception handler

14 years agofix the deprecation message (GHC.IO.Handle.Base -> GHC.IO.Handle)
Simon Marlow [Tue, 30 Mar 2010 12:11:37 +0000 (12:11 +0000)]
fix the deprecation message (GHC.IO.Handle.Base -> GHC.IO.Handle)

14 years agoMake SampleVar an abstract newtype
Bas van Dijk [Thu, 18 Mar 2010 20:03:49 +0000 (20:03 +0000)]
Make SampleVar an abstract newtype

14 years agoFix bugs regarding asynchronous exceptions and laziness in Control.Concurrent.SampleVar
Bas van Dijk [Thu, 18 Mar 2010 20:01:04 +0000 (20:01 +0000)]
Fix bugs regarding asynchronous exceptions and laziness in Control.Concurrent.SampleVar
 - Block asynchronous exceptions at the right places
 - Force thunks before putting them in a MVar

14 years agoWrite the thunk 'next' to the MVar
Bas van Dijk [Fri, 19 Mar 2010 12:59:51 +0000 (12:59 +0000)]
Write the thunk 'next' to the MVar

14 years agochange to use STM, fixing 4 things
Simon Marlow [Thu, 18 Mar 2010 10:44:36 +0000 (10:44 +0000)]
change to use STM, fixing 4 things
  1. there was no async exception protection
  2. there was a space leak (now new value is strict)
  3. using atomicModifyIORef would be slightly quicker, but can
     suffer from adverse scheduling issues (see #3838)
  4. also, the STM version is faster.

14 years agoTweak docs
Ian Lynagh [Fri, 12 Mar 2010 21:41:29 +0000 (21:41 +0000)]
Tweak docs

14 years agoFixed dead links in documentation of forkIO
Bas van Dijk [Mon, 8 Mar 2010 22:24:15 +0000 (22:24 +0000)]
Fixed dead links in documentation of forkIO

14 years agoDocumentation fixes in Control.Exception
Bas van Dijk [Mon, 1 Mar 2010 22:04:42 +0000 (22:04 +0000)]
Documentation fixes in Control.Exception

14 years agoPlug two race conditions that could lead to deadlocks in the IO manager
Simon Marlow [Thu, 25 Feb 2010 12:02:55 +0000 (12:02 +0000)]
Plug two race conditions that could lead to deadlocks in the IO manager