packages/base.git
7 years agoMove GHC.Generics to base
Jose Pedro Magalhaes [Thu, 21 Jun 2012 11:11:07 +0000 (12:11 +0100)] 
Move GHC.Generics to base

There is no real reason for it to be in ghc-prim, and it
complicates things.

7 years agoUse round-to-even when formatting floats (#5963)
Paolo Capriotti [Wed, 20 Jun 2012 15:18:10 +0000 (16:18 +0100)] 
Use round-to-even when formatting floats (#5963)

Patch by Lennart Augustsson.

7 years agoUpdate tests following changes in base
Ian Lynagh [Wed, 20 Jun 2012 12:22:02 +0000 (13:22 +0100)] 
Update tests following changes in base

7 years agoBump base's version
Ian Lynagh [Tue, 19 Jun 2012 19:12:54 +0000 (20:12 +0100)] 
Bump base's version

7 years agoFix typos
Ian Lynagh [Tue, 19 Jun 2012 19:00:56 +0000 (20:00 +0100)] 
Fix typos

7 years agoMerge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base
Ian Lynagh [Tue, 19 Jun 2012 18:36:46 +0000 (19:36 +0100)] 
Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base

7 years agoUse divInteger and modInteger
Ian Lynagh [Tue, 19 Jun 2012 18:35:56 +0000 (19:35 +0100)] 
Use divInteger and modInteger

7 years agoMove divInt#/modInt# to ghc-prim
Ian Lynagh [Tue, 19 Jun 2012 18:20:46 +0000 (19:20 +0100)] 
Move divInt#/modInt# to ghc-prim

This allows them to be shared with integer-gmp

7 years agoRemove Prelude.catch and System.IO.Error.{catch,try}
Ian Lynagh [Tue, 19 Jun 2012 18:07:33 +0000 (19:07 +0100)] 
Remove Prelude.catch and System.IO.Error.{catch,try}

This completes the proposal from trac #4865.

7 years agoExport ForeignPtrContents in GHC.ForeignPtr (#7012)
Paolo Capriotti [Tue, 19 Jun 2012 16:24:32 +0000 (17:24 +0100)] 
Export ForeignPtrContents in GHC.ForeignPtr (#7012)

7 years agoAdd GHC.Stats.getGCStatsEnabled function (#5846)
Paolo Capriotti [Fri, 15 Jun 2012 16:13:16 +0000 (17:13 +0100)] 
Add GHC.Stats.getGCStatsEnabled function (#5846)

Add getGCStatsEnabled function which checks whether GC stats have been
enabled (with `-T`, for example).

Make getGCStats throw an exception if called with GC stats disabled.

7 years agoFix typo; spotted by Gabor Greif
Ian Lynagh [Thu, 14 Jun 2012 19:01:15 +0000 (20:01 +0100)] 
Fix typo; spotted by Gabor Greif

7 years agoAdd GHC.IP for the new implicit-parameter story
Simon Peyton Jones [Wed, 13 Jun 2012 16:24:02 +0000 (17:24 +0100)] 
Add GHC.IP for the new implicit-parameter story

7 years agofix another theoretical deadlock bug in the Chan implementation (c.f. #6153)
Simon Marlow [Mon, 11 Jun 2012 08:54:06 +0000 (09:54 +0100)] 
fix another theoretical deadlock bug in the Chan implementation (c.f. #6153)

7 years agoadd modifyMVarMasked, modifyMVarMasked_
Simon Marlow [Mon, 11 Jun 2012 08:52:23 +0000 (09:52 +0100)] 
add modifyMVarMasked, modifyMVarMasked_

7 years agoadd tests for deadlocks in readChan & writeChan
Simon Marlow [Mon, 11 Jun 2012 08:51:36 +0000 (09:51 +0100)] 
add tests for deadlocks in readChan & writeChan

7 years agoFix warning.
Paolo Capriotti [Fri, 8 Jun 2012 14:19:46 +0000 (15:19 +0100)] 
Fix warning.

7 years agoadd forkFinally
Simon Marlow [Thu, 7 Jun 2012 15:10:47 +0000 (16:10 +0100)] 
add forkFinally

This is a more robust version of "forkIO (m `finally` k)", because it
closes a window between thread creation and the finally where the
thread can receive an async exception.  Useful for layers over threads
that need to catch threads dying with absolute certainty.

forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId
forkFinally action and_then =
  mask $ \restore ->
    forkIO $ try (restore action) >>= and_then

7 years agoAllow openTempFile to retry when it hits a directory (#4968).
Paolo Capriotti [Thu, 7 Jun 2012 10:18:00 +0000 (11:18 +0100)] 
Allow openTempFile to retry when it hits a directory (#4968).

Windows returns an EACCES error instead of EEXIST when a call to `open`
fails due to an existing directory, so add a special case for this
situation.

7 years agoRefactor findTempName: factor out file creation.
Paolo Capriotti [Thu, 7 Jun 2012 09:51:27 +0000 (10:51 +0100)] 
Refactor findTempName: factor out file creation.

Add openNewFile function, which creates a new file and returns a file
descriptor for it.

7 years agoMake Sing kind-polymorphic
Simon Peyton Jones [Thu, 7 Jun 2012 13:08:53 +0000 (14:08 +0100)] 
Make Sing kind-polymorphic

7 years agoRe-export Fingerprint in Data.Typeable.Internal.
Paolo Capriotti [Tue, 5 Jun 2012 15:51:59 +0000 (16:51 +0100)] 
Re-export Fingerprint in Data.Typeable.Internal.

7 years agoadd mkWeakMVar; deprecate addMVarFinalizer (#6130)
Simon Marlow [Mon, 4 Jun 2012 09:34:30 +0000 (10:34 +0100)] 
add mkWeakMVar; deprecate addMVarFinalizer (#6130)

7 years agoUpdate documentation of intersectBy
A. Bram Neijt [Sun, 22 Apr 2012 12:52:00 +0000 (14:52 +0200)] 
Update documentation of intersectBy

Mention which list is the source
of the elements in the resulting list.

7 years agoFix typo in documentation of GHC.Exts.groupWith
Simon Hengel [Thu, 10 May 2012 08:44:36 +0000 (10:44 +0200)] 
Fix typo in documentation of GHC.Exts.groupWith

7 years agoUse expect_broken rather than expect_fail in testsuite driver
Ian Lynagh [Sat, 26 May 2012 15:38:18 +0000 (16:38 +0100)] 
Use expect_broken rather than expect_fail in testsuite driver

7 years agoMove the Word type from base to ghc-prim
Ian Lynagh [Mon, 21 May 2012 22:20:41 +0000 (23:20 +0100)] 
Move the Word type from base to ghc-prim

7 years agoUse Word literals directly, rather than converting Int literals
Ian Lynagh [Mon, 21 May 2012 19:41:51 +0000 (20:41 +0100)] 
Use Word literals directly, rather than converting Int literals

7 years agoRemove some more specialise-Int code
Ian Lynagh [Mon, 21 May 2012 19:29:11 +0000 (20:29 +0100)] 
Remove some more specialise-Int code

7 years agoRemove some commented out code
Ian Lynagh [Mon, 21 May 2012 19:16:54 +0000 (20:16 +0100)] 
Remove some commented out code

Commented out since 2005, so doesn't seem worth maintaining it

7 years agoRemove some unnecessary Int specialised values
Ian Lynagh [Mon, 21 May 2012 19:00:46 +0000 (20:00 +0100)] 
Remove some unnecessary Int specialised values

We no longer need zeroInt and friends

7 years agoChange a few FFI imports to use CAPI
Ian Lynagh [Sun, 20 May 2012 12:48:20 +0000 (13:48 +0100)] 
Change a few FFI imports to use CAPI

On Win64, ssize_t is 64 bit, but functions like read return 32 bit
ints. The CAPI wrapper means the C compiler takes care of doing all
the necessary casting.

Technically we should instead be making the types of the FFI imports
different on different platforms, but I think this will work out
simpler overall.

Before this fix, when the functions failed with -1, we thought they
were returning with 4294967295, and so didn't throw an exception.
This lead to a segfault in echo001(ghci).

7 years agoDon't use stdcall on Win64: It isn't supported; ccall is used instead
Ian Lynagh [Wed, 16 May 2012 14:31:41 +0000 (15:31 +0100)] 
Don't use stdcall on Win64: It isn't supported; ccall is used instead

7 years agoUpdate to support singleton types with custom implementations.
Iavor S. Diatchki [Sat, 12 May 2012 18:31:33 +0000 (11:31 -0700)] 
Update to support singleton types with custom implementations.

Now 'Sing' is a data family, and users may provide data instances
to implement singletons of new kinds.

7 years agoModify 'SingRep' to support arbitrary singleton types.
Iavor S. Diatchki [Fri, 11 May 2012 22:34:04 +0000 (15:34 -0700)] 
Modify 'SingRep' to support arbitrary singleton types.

7 years agoFix build.
Paolo Capriotti [Tue, 8 May 2012 19:17:45 +0000 (20:17 +0100)] 
Fix build.

7 years agoUse in-process file locking on Windows (#4363)
Paolo Capriotti [Tue, 8 May 2012 13:07:11 +0000 (14:07 +0100)] 
Use in-process file locking on Windows (#4363)

7 years agoUse RTS version of getMonotonicNSec on Windows (#6061)
Paolo Capriotti [Tue, 8 May 2012 12:06:12 +0000 (13:06 +0100)] 
Use RTS version of getMonotonicNSec on Windows (#6061)

7 years agoUse IORef/atomicModifyIORef instead of STM
Simon Marlow [Tue, 1 May 2012 10:57:56 +0000 (11:57 +0100)] 
Use IORef/atomicModifyIORef instead of STM

Follows discussion on the libraries@ mailing list; see comments for
rationale.

7 years agoFix an off-by-one error in freeProgArgv
Ian Lynagh [Wed, 2 May 2012 12:39:26 +0000 (13:39 +0100)] 
Fix an off-by-one error in freeProgArgv

7 years agoTidy up the ThreadDelay001 test code
Ian Lynagh [Tue, 1 May 2012 16:38:41 +0000 (17:38 +0100)] 
Tidy up the ThreadDelay001 test code

7 years agosystem001 test is expected to fail on Win64
Ian Lynagh [Tue, 1 May 2012 16:35:35 +0000 (17:35 +0100)] 
system001 test is expected to fail on Win64

7 years agoFix some more tests on Win64
Ian Lynagh [Tue, 1 May 2012 13:19:51 +0000 (14:19 +0100)] 
Fix some more tests on Win64

7 years agoRemove old test outputs
Ian Lynagh [Tue, 1 May 2012 13:10:14 +0000 (14:10 +0100)] 
Remove old test outputs

These files are no longer used

7 years agoAdd a type-family for comparing numbers.
Iavor S. Diatchki [Tue, 1 May 2012 06:08:54 +0000 (23:08 -0700)] 
Add a type-family for comparing numbers.

For the moment, this replaces the class (<=) because it is
easier to fit with GHC's coercion evidence.

7 years agoFix openFile003 for Win64
Ian Lynagh [Mon, 30 Apr 2012 23:59:23 +0000 (00:59 +0100)] 
Fix openFile003 for Win64

7 years agouse mkWeakNoFinalizer# (#5879)
Simon Marlow [Fri, 27 Apr 2012 10:12:06 +0000 (11:12 +0100)] 
use mkWeakNoFinalizer# (#5879)

7 years agoDon't include sys/timeb.h on FreeBSD.
Geoffrey Mainland [Wed, 25 Apr 2012 21:34:26 +0000 (22:34 +0100)] 
Don't include sys/timeb.h on FreeBSD.

sys/timeb.h is deprecated on FreeBSD meaning validation fails quite early
without this patch.

7 years agoDEPRECATE Foreign.Marshal.Error.void (use Control.Monad.void instead)
Simon Marlow [Mon, 16 Apr 2012 15:45:08 +0000 (16:45 +0100)] 
DEPRECATE Foreign.Marshal.Error.void (use Control.Monad.void instead)

7 years agoAdd GHCi monad. Experimental for now.
David Terei [Tue, 24 Apr 2012 23:16:48 +0000 (16:16 -0700)] 
Add GHCi monad. Experimental for now.

7 years agoRemove hardcoded mangling of the n_capability symbol (#5864)
Paolo Capriotti [Tue, 24 Apr 2012 10:35:35 +0000 (11:35 +0100)] 
Remove hardcoded mangling of the n_capability symbol (#5864)

This was breaking cross-module inlining, since the symbol ended up being
mangled twice, if the call happened to be inlined into another module.

7 years agoAdd timer initialization for darwin.
Paolo Capriotti [Mon, 16 Apr 2012 13:47:36 +0000 (14:47 +0100)] 
Add timer initialization for darwin.

7 years agoReplace getUSecOfDay with monotonic timer (#5865)
Paolo Capriotti [Fri, 23 Mar 2012 14:26:20 +0000 (14:26 +0000)] 
Replace getUSecOfDay with monotonic timer (#5865)

7 years agoDefine monotonic time function for Darwin.
Paolo Capriotti [Fri, 23 Mar 2012 17:22:20 +0000 (17:22 +0000)] 
Define monotonic time function for Darwin.

7 years agoUse monotonic time in Event/Manager.hs.
Paolo Capriotti [Mon, 19 Mar 2012 18:00:48 +0000 (18:00 +0000)] 
Use monotonic time in Event/Manager.hs.

7 years agoRevert "Add GHCi monad"
David Terei [Fri, 13 Apr 2012 11:23:09 +0000 (04:23 -0700)] 
Revert "Add GHCi monad"

This reverts commit 7e04ab6158957c90e3c68911b6909b6ef69621da.

7 years agoAdd GHCi monad
David Terei [Wed, 8 Feb 2012 23:08:07 +0000 (15:08 -0800)] 
Add GHCi monad

7 years agodoc tweaks
Simon Marlow [Thu, 12 Apr 2012 10:19:04 +0000 (11:19 +0100)] 
doc tweaks

7 years agomove mkWeakThreadId to GHC.Conc.Sync; export it from Control.Concurrent
Simon Marlow [Thu, 12 Apr 2012 10:04:54 +0000 (11:04 +0100)] 
move mkWeakThreadId to GHC.Conc.Sync; export it from Control.Concurrent

7 years agoadd "Portions obtained from hbc (c) Lennart Augusstson" (#5963)
Simon Marlow [Thu, 12 Apr 2012 08:37:56 +0000 (09:37 +0100)] 
add "Portions obtained from hbc (c) Lennart Augusstson" (#5963)

7 years agobugfix: use forkIOWithUnmask rather than forkIO
Simon Marlow [Wed, 11 Apr 2012 09:03:45 +0000 (10:03 +0100)] 
bugfix: use forkIOWithUnmask rather than forkIO

7 years agoAdd testcase for #5930.
Paolo Capriotti [Tue, 10 Apr 2012 12:40:25 +0000 (13:40 +0100)] 
Add testcase for #5930.

7 years agoAdd System.Environment.lookupEnv (#5930)
Paolo Capriotti [Tue, 10 Apr 2012 12:36:49 +0000 (13:36 +0100)] 
Add System.Environment.lookupEnv (#5930)

Based on a patch by Evan Laforge <qdunkan@gmail.com>

7 years agoWhitespace only: convert mixed tabs and spaces to spaces.
Evan Laforge [Mon, 12 Mar 2012 01:23:43 +0000 (18:23 -0700)] 
Whitespace only: convert mixed tabs and spaces to spaces.

Signed-off-by: Paolo Capriotti <p.capriotti@gmail.com>
7 years agoRewrite to use just one notion of singletons.
Iavor S. Diatchki [Mon, 9 Apr 2012 02:37:56 +0000 (19:37 -0700)] 
Rewrite to use just one notion of singletons.

This avoids the duplication of types and classes for each separate
type of literal: before we had two copies of most functions, one for
numbers and one for strings.  Now we just have one polymorphic (both
at the type and the kind level!) version, which uses a type function
and polymorphic kinds in an interesting way.

7 years agoRename parAvgBytesCopied to parTotBytesCopied
Mikolaj Konarski [Thu, 8 Mar 2012 15:33:46 +0000 (16:33 +0100)] 
Rename parAvgBytesCopied to parTotBytesCopied

This follows a change in GHC and ghc-events. The previous name was misleading.

From commit "Change the presentation of parallel GC work balance in +RTS -s":

    Also rename internal variables to make the names match what they hold.
    The parallel GC work balance is calculated using the total amount of
    memory copied by all GC threads, and the maximum copied by any
    individual thread. You have serial GC when the max is the same as
    copied, and perfectly balanced GC when total/max == n_caps.

7 years agoTest Trac #5962
Simon Peyton Jones [Fri, 30 Mar 2012 11:54:34 +0000 (12:54 +0100)] 
Test Trac #5962

7 years agoFix an egregious bug in the fingerprint calculation for TypeRep
Simon Peyton Jones [Fri, 30 Mar 2012 11:51:14 +0000 (12:51 +0100)] 
Fix an egregious bug in the fingerprint calculation for TypeRep

Given (T ty1) and ty2, we were computing the fingerprint of the
application (T ty1 ty2) by combining the two fingerprints from (T ty1)
and ty2.  But that gives a different answer to combinging the three
fingerprints from T, ty1, and ty2, which is what happens if you
build the type all at once.  Urk!

Fixes Trac #5962

7 years agoEnsure hGetBufSome does not cause potentially blocking reads (#5843)
Paolo Capriotti [Tue, 27 Mar 2012 15:37:06 +0000 (16:37 +0100)] 
Ensure hGetBufSome does not cause potentially blocking reads (#5843)

When there is data in a handle buffer, never fetch more than the
available number of elements, since that can cause a blocking read on
Windows.

7 years agoMerge remote-tracking branch 'origin/master' into type-nats
Iavor S. Diatchki [Sat, 24 Mar 2012 23:23:17 +0000 (16:23 -0700)] 
Merge remote-tracking branch 'origin/master' into type-nats

7 years agoadd test for #5943
Simon Marlow [Fri, 23 Mar 2012 15:00:34 +0000 (15:00 +0000)] 
add test for #5943

7 years agochange unsafeDupableInterleaveIO from INLINE to NOINLINE (#5943)
Simon Marlow [Fri, 23 Mar 2012 12:28:18 +0000 (12:28 +0000)] 
change unsafeDupableInterleaveIO from INLINE to NOINLINE (#5943)

See the comment for details.

7 years agoRevert IsEven to the way it was.
Iavor S. Diatchki [Thu, 22 Mar 2012 07:46:22 +0000 (00:46 -0700)] 
Revert IsEven to the way it was.

7 years agoFix the type of IsEven
Iavor S. Diatchki [Thu, 22 Mar 2012 03:17:29 +0000 (20:17 -0700)] 
Fix the type of IsEven

7 years agoMerge remote-tracking branch 'origin/master' into type-nats
Iavor S. Diatchki [Tue, 20 Mar 2012 03:09:14 +0000 (20:09 -0700)] 
Merge remote-tracking branch 'origin/master' into type-nats

7 years agoAdd some useful functions for working with type literals.
Iavor S. Diatchki [Tue, 20 Mar 2012 03:09:03 +0000 (20:09 -0700)] 
Add some useful functions for working with type literals.

7 years agoFix typo in Data.List.(\\) documentation
Joachim Breitner [Fri, 16 Mar 2012 20:53:50 +0000 (21:53 +0100)] 
Fix typo in Data.List.(\\) documentation

7 years agoMerge remote-tracking branch 'origin/master' into type-nats
Iavor S. Diatchki [Sun, 18 Mar 2012 22:26:16 +0000 (15:26 -0700)] 
Merge remote-tracking branch 'origin/master' into type-nats

7 years agoUpdate gitignore
David Terei [Wed, 14 Mar 2012 21:37:03 +0000 (14:37 -0700)] 
Update gitignore

7 years agoAdd strict versions of modifyIORef and atomicModifyIORef
Joey Adams [Sun, 11 Mar 2012 00:15:40 +0000 (19:15 -0500)] 
Add strict versions of modifyIORef and atomicModifyIORef

7 years agoMerge branch 'master' into type-nats
Iavor S. Diatchki [Wed, 14 Mar 2012 05:00:16 +0000 (22:00 -0700)] 
Merge branch 'master' into type-nats

7 years agoSealed writeChan with mask_ to prevent a theoretical bug
Joey Adams [Sun, 12 Feb 2012 21:08:07 +0000 (16:08 -0500)] 
Sealed writeChan with mask_ to prevent a theoretical bug

7 years agoAvoid making huge Rational's when reading Double/Float; fixes #5688
Ian Lynagh [Sun, 11 Mar 2012 12:31:25 +0000 (12:31 +0000)] 
Avoid making huge Rational's when reading Double/Float; fixes #5688

7 years agoCopy tests from GHC testsuite; part of #1161.
Paolo Capriotti [Fri, 9 Mar 2012 11:42:24 +0000 (11:42 +0000)] 
Copy tests from GHC testsuite; part of #1161.

7 years agoMake "100e12" not parse as an Integer; part of #5688
Ian Lynagh [Thu, 1 Mar 2012 14:05:36 +0000 (14:05 +0000)] 
Make "100e12" not parse as an Integer; part of #5688

The report says that it isn't meant to.

7 years agoAdd a readInteger001 test
Ian Lynagh [Thu, 1 Mar 2012 14:03:31 +0000 (14:03 +0000)] 
Add a readInteger001 test

7 years agoChange how NaN and Infinity are read by lex
Ian Lynagh [Thu, 1 Mar 2012 13:58:18 +0000 (13:58 +0000)] 
Change how NaN and Infinity are read by lex

They now get read as Ident's, and the Read Double/Float instances
(via convertFrac) handle that Ident specially.

7 years agoAdd a test for reading Doubles
Ian Lynagh [Thu, 1 Mar 2012 13:57:54 +0000 (13:57 +0000)] 
Add a test for reading Doubles

7 years agoRename lexNum test to lex001, and expand it
Ian Lynagh [Thu, 1 Mar 2012 13:42:25 +0000 (13:42 +0000)] 
Rename lexNum test to lex001, and expand it

7 years agoRefactor number lexing; part of #5688
Ian Lynagh [Thu, 1 Mar 2012 01:26:06 +0000 (01:26 +0000)] 
Refactor number lexing; part of #5688

This doesn't change the behaviour yet, but I think it's a step in the
right direction.

7 years agoRemove some redundant imports
Ian Lynagh [Wed, 29 Feb 2012 01:23:06 +0000 (01:23 +0000)] 
Remove some redundant imports

7 years agoMove chr's definition into a new GHC.Char
Ian Lynagh [Tue, 28 Feb 2012 23:59:35 +0000 (23:59 +0000)] 
Move chr's definition into a new GHC.Char

This eliminates a SOURCE import

7 years agoRemove some __HADDOCK__ CPP
Ian Lynagh [Tue, 28 Feb 2012 21:39:48 +0000 (21:39 +0000)] 
Remove some __HADDOCK__ CPP

I think it was all to work around problems in old versions of haddock.

7 years agoMove nocldstop from HsBase.h to HsUnix.h
Ian Lynagh [Sun, 26 Feb 2012 17:07:09 +0000 (17:07 +0000)] 
Move nocldstop from HsBase.h to HsUnix.h

7 years agoUse CAPI for lseek
Ian Lynagh [Sun, 26 Feb 2012 16:07:03 +0000 (16:07 +0000)] 
Use CAPI for lseek

7 years agoRemove another unused definition
Ian Lynagh [Sun, 26 Feb 2012 15:23:21 +0000 (15:23 +0000)] 
Remove another unused definition

7 years agoRemove some unused code
Ian Lynagh [Sun, 26 Feb 2012 15:19:19 +0000 (15:19 +0000)] 
Remove some unused code

7 years agoConvert some FFI bindings to use "value" imports
Ian Lynagh [Sun, 26 Feb 2012 13:52:26 +0000 (13:52 +0000)] 
Convert some FFI bindings to use "value" imports

7 years agoRemove an unsed definition in HsBase.h
Ian Lynagh [Wed, 22 Feb 2012 13:57:33 +0000 (13:57 +0000)] 
Remove an unsed definition in HsBase.h

Bytestring uses it, so I've moved it into that package.

7 years agoFix an FFI decl: it should have been using capi but was using ccall
Ian Lynagh [Wed, 22 Feb 2012 01:46:30 +0000 (01:46 +0000)] 
Fix an FFI decl: it should have been using capi but was using ccall