packages/base.git
5 years agoAdd `{-# MINIMAL #-}` annotations to typeclasses
Herbert Valerio Riedel [Wed, 18 Sep 2013 08:45:38 +0000 (10:45 +0200)] 
Add `{-# MINIMAL #-}` annotations to typeclasses

This makes use of the new `{-# MINIMAL #-}` facility (see #7633)
for the following typeclasses

 - `Bits`
 - `Foldable`
 - `Fractional`
 - `Num`
 - `MonadZip`
 - `Read`
 - `Show`
 - `Storable`
 - `Traversable`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoUpdate use of role annotations to new syntax.
Richard Eisenberg [Fri, 13 Sep 2013 14:46:31 +0000 (10:46 -0400)] 
Update use of role annotations to new syntax.

5 years agoReplaced Text.Printf with extensible printf, and made comcommitant changes
Bart Massey [Mon, 16 Sep 2013 18:07:52 +0000 (11:07 -0700)] 
Replaced Text.Printf with extensible printf, and made comcommitant changes

Signed-off-by: Joachim Breitner <mail@joachim-breitner.de>
5 years agoMake `<Typeable.h>` obsolete and refactor away its use
Herbert Valerio Riedel [Sun, 15 Sep 2013 21:49:32 +0000 (23:49 +0200)] 
Make `<Typeable.h>` obsolete and refactor away its use

With GHC 7.8's PolyKinds the macros in `<Typeable.h>` are no longer of any
use, and their use is clearly obsolete. The sites using those macros are
replaced by auto-derivations of `Typeable` instances.

This reduces reliance on the CPP extension and the compile dependency on
`Typeable.h` in a couple of modules.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoConstant-fold `__GLASGOW_HASKELL__` CPP conditionals
Herbert Valerio Riedel [Sun, 15 Sep 2013 21:05:05 +0000 (23:05 +0200)] 
Constant-fold `__GLASGOW_HASKELL__` CPP conditionals

Now that HUGS and NHC specific code has been removed, this commit "folds"
the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`.  This
renders `base` officially GHC only.

This commit also removes redundant `{-# LANGUAGE CPP #-}`.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoRemove Hugs98 specific code
Herbert Valerio Riedel [Sun, 15 Sep 2013 08:58:00 +0000 (10:58 +0200)] 
Remove Hugs98 specific code

For rationale. see
 http://permalink.gmane.org/gmane.comp.lang.haskell.ghc.devel/2349

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAdd Data.Bool.bool (fixes #8302)
Oliver Charles [Sun, 15 Sep 2013 00:23:56 +0000 (01:23 +0100)] 
Add Data.Bool.bool (fixes #8302)

5 years agobyteSwap16/32: Narrow the result to 16/32 bits
Reid Barton [Sun, 8 Sep 2013 01:07:30 +0000 (21:07 -0400)] 
byteSwap16/32: Narrow the result to 16/32 bits

According to primops.txt.pp, the BSwap16Op and BSwap32Op primops
leave the higher bytes of their results undefined. We must clear
those higher bytes here before storing the result in a Word16/32.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd `Data` instance for `Data.Version`
Herbert Valerio Riedel [Fri, 13 Sep 2013 09:19:36 +0000 (11:19 +0200)] 
Add `Data` instance for `Data.Version`

See also

  http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/20269

Patch from Edward Kmett (essentially.)

Authored-by: Edward Kmett <ekmett@gmail.com>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoUpdate Git repo URL in `base.cabal`
Herbert Valerio Riedel [Wed, 11 Sep 2013 13:15:01 +0000 (15:15 +0200)] 
Update Git repo URL in `base.cabal`

This is related to #8121

5 years agoRedo <= with a type synonym instead of a class, add instance for boolean singletons...
Iavor S. Diatchki [Sun, 8 Sep 2013 21:38:47 +0000 (14:38 -0700)] 
Redo <= with a type synonym instead of a class, add instance for boolean singletons, remove (-)

5 years agoRevert "length001 passes now"
Austin Seipp [Sun, 8 Sep 2013 21:19:17 +0000 (16:19 -0500)] 
Revert "length001 passes now"

This reverts commit 1be0171fc8c911a7ce3d1e3926475e789d077724.

5 years agoRevert "GHC.Conc.Sync: Pass TSO to stackOverflow"
Austin Seipp [Sun, 8 Sep 2013 21:19:16 +0000 (16:19 -0500)] 
Revert "GHC.Conc.Sync: Pass TSO to stackOverflow"

This reverts commit 0cfba06e09cae209c6fc1f94edd815ccf5a7e9d7.

5 years agoEventManager: Gracefully handle an initial 'Finished' state (#8235)
Patrick Palka [Sun, 8 Sep 2013 16:22:01 +0000 (12:22 -0400)] 
EventManager: Gracefully handle an initial 'Finished' state (#8235)

Signed-off-by: Andreas Voellmy <andreas.voellmy@gmail.com>
5 years agolength001 passes now
Austin Seipp [Sun, 8 Sep 2013 08:52:48 +0000 (03:52 -0500)] 
length001 passes now

It no longer stack overflows, since the stack is infinite by default
now.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
5 years agoGHC.Conc.Sync: Pass TSO to stackOverflow
Ben Gamari [Sat, 7 Sep 2013 22:16:52 +0000 (18:16 -0400)] 
GHC.Conc.Sync: Pass TSO to stackOverflow

Signed-off-by: Austin Seipp <aseipp@pobox.com>
5 years agoSwitch IO manager to a mutable hashtable
Bryan O'Sullivan [Wed, 14 Aug 2013 10:43:36 +0000 (03:43 -0700)] 
Switch IO manager to a mutable hashtable

This data structure (IntTable) provides a similar API to its predecessor
(IntMap), at half the number of lines in size.

When tested in isolation using criterion, IntTable is much faster than
IntMap: over 15x, according to my criterion benchmarks.

This translates into a measurable improvement when used in the IO manager:
using weighttp to benchmark acme-http under various configurations on two
32-core Linux servers connected by a 10gbE network, I see between a 3%
and 10% increase in requests served per second compared to IntMap.

Signed-off-by: Andreas Voellmy <andreas.voellmy@gmail.com>
5 years agoFix off-by-one error in the IO manager
Patrick Palka [Sun, 1 Sep 2013 21:34:31 +0000 (17:34 -0400)] 
Fix off-by-one error in the IO manager

The last enabled event manager was being needlessly restarted after
increasing the number of capabilities at runtime.

6 years agoComments only
Jan Stolarek [Fri, 23 Aug 2013 07:49:28 +0000 (08:49 +0100)] 
Comments only

Add note for Integre constant folding

6 years agoRemove trailing whitespace from GHC.Fingerprint.*
Austin Seipp [Thu, 22 Aug 2013 21:31:42 +0000 (16:31 -0500)] 
Remove trailing whitespace from GHC.Fingerprint.*

Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoFix -Werror failure in GHC.Fingerprint
Austin Seipp [Thu, 22 Aug 2013 21:21:58 +0000 (16:21 -0500)] 
Fix -Werror failure in GHC.Fingerprint

Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoFingerprint: Add getFileHash
Niklas Hambüchen [Thu, 22 Aug 2013 02:22:02 +0000 (11:22 +0900)] 
Fingerprint: Add getFileHash

Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoFingerprint: Add Show instance for easier debugging
Niklas Hambüchen [Thu, 22 Aug 2013 02:18:25 +0000 (11:18 +0900)] 
Fingerprint: Add Show instance for easier debugging

Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoUse primop wrappers instead of tagToEnum#
Jan Stolarek [Fri, 16 Aug 2013 16:14:16 +0000 (17:14 +0100)] 
Use primop wrappers instead of tagToEnum#

6 years agoComparison primops return Int# (Fixes #6135)
Jan Stolarek [Sun, 14 Apr 2013 10:35:23 +0000 (12:35 +0200)] 
Comparison primops return Int# (Fixes #6135)

For a deatiled discussion of this changes please visit the wiki page:
http://hackage.haskell.org/trac/ghc/wiki/PrimBool

6 years agoMark the roles of Ptr and FunPtr as R, not P!
Richard Eisenberg [Fri, 2 Aug 2013 14:52:02 +0000 (15:52 +0100)] 
Mark the roles of Ptr and FunPtr as R, not P!

6 years agoWe need NegativeLiterals for GHC.Int or we get warnings
Ian Lynagh [Wed, 31 Jul 2013 17:51:36 +0000 (18:51 +0100)] 
We need NegativeLiterals for GHC.Int or we get warnings

6 years agoAdd asProxyTypeOf and Trustworthy pragma to Data.Proxy
Richard Eisenberg [Wed, 31 Jul 2013 17:35:10 +0000 (18:35 +0100)] 
Add asProxyTypeOf and Trustworthy pragma to Data.Proxy

6 years agoEliminate Equality.hs-boot and Proxy.hs-boot by moving instances
Richard Eisenberg [Thu, 25 Jul 2013 10:25:38 +0000 (11:25 +0100)] 
Eliminate Equality.hs-boot and Proxy.hs-boot by moving instances

6 years agoImplement "TypeLevelReasoning" proposal at wiki:TypeLevelReasoning
Richard Eisenberg [Wed, 24 Jul 2013 11:38:50 +0000 (12:38 +0100)] 
Implement "TypeLevelReasoning" proposal at wiki:TypeLevelReasoning

This commit includes a propositional equality (:=:) in Data.Type.Equality,
a Proxy type in Data.Proxy, and has updates to Typeable.

There is an unfortunate number of hs-boot files necessary, but that
seems cleaner than moving Typeable instances around willy-nilly.

6 years agoFix bug in IO manager when number of capabilities is changed; fixes #8087
Ian Lynagh [Tue, 23 Jul 2013 20:39:02 +0000 (21:39 +0100)] 
Fix bug in IO manager when number of capabilities is changed; fixes #8087

Patch from parcs.

6 years agoFix GHC.Enum on 32bit platforms; fixes #8072
Ian Lynagh [Sun, 21 Jul 2013 18:09:45 +0000 (19:09 +0100)] 
Fix GHC.Enum on 32bit platforms; fixes #8072

Diagnosed by int-e.

MachDeps.h wasn't being included in Enum.lhs, and the old
WORD_SIZE_IN_BITS test didn't fail when WORD_SIZE_IN_BITS isn't
defined. Now we get an error instead.

6 years agoAdd test for #7787
Simon Marlow [Fri, 19 Jul 2013 09:17:05 +0000 (10:17 +0100)] 
Add test for #7787

6 years agoFix #7787
Simon Marlow [Fri, 19 Jul 2013 08:09:39 +0000 (09:09 +0100)] 
Fix #7787

Now the pair is evaluated strictly inside the exception handler.  I
figured this would be less likely to introduce space leaky bugs than
using an irrefutable pattern match.

6 years agoExpose new Word operation to swap endianness for Word{16,32,64}
Austin Seipp [Wed, 17 Jul 2013 09:00:33 +0000 (04:00 -0500)] 
Expose new Word operation to swap endianness for Word{16,32,64}

Authored-by: Vincent Hanquez <tab@snarc.org>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoMinor rewording.
Edward Z. Yang [Sun, 14 Jul 2013 21:36:52 +0000 (14:36 -0700)] 
Minor rewording.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agoRename atomicReadMVar and friends to readMVar, replacing old readMVar.
Edward Z. Yang [Sat, 13 Jul 2013 01:12:44 +0000 (18:12 -0700)] 
Rename atomicReadMVar and friends to readMVar, replacing old readMVar.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agoFix build.
Austin Seipp [Thu, 11 Jul 2013 18:25:11 +0000 (13:25 -0500)] 
Fix build.

We forgot to import tryAtomicReadMVar.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoImplement tryAtomicReadMVar.
Edward Z. Yang [Wed, 10 Jul 2013 20:34:09 +0000 (13:34 -0700)] 
Implement tryAtomicReadMVar.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agoAdd atomicReadMVar to Control.Concurrent.MVar and friends.
Edward Z. Yang [Fri, 14 Jun 2013 21:19:58 +0000 (14:19 -0700)] 
Add atomicReadMVar to Control.Concurrent.MVar and friends.

Also renumber thread statuses as necessary.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agoDerive Show, Eq, Ord, Read for Control.Applicative.ZipList; fixes #5787
Ian Lynagh [Sun, 7 Jul 2013 18:00:06 +0000 (19:00 +0100)] 
Derive Show, Eq, Ord, Read for Control.Applicative.ZipList; fixes #5787

Patch from merijn.

6 years agoAdd a section of documentation about the interaction of threads and finalizers
Simon Marlow [Tue, 2 Jul 2013 16:10:30 +0000 (17:10 +0100)] 
Add a section of documentation about the interaction of threads and finalizers

6 years agofix markup bugs
Simon Marlow [Tue, 2 Jul 2013 16:10:17 +0000 (17:10 +0100)] 
fix markup bugs

6 years agoCatch an illegal pragma and fix a typo
Gabor Greif [Wed, 26 Jun 2013 23:06:22 +0000 (01:06 +0200)] 
Catch an illegal pragma and fix a typo

6 years agoFix build on OS X
Ian Lynagh [Sat, 22 Jun 2013 14:05:58 +0000 (15:05 +0100)] 
Fix build on OS X

6 years agoIgnore editor backup files
Gabor Greif [Fri, 21 Jun 2013 10:44:07 +0000 (12:44 +0200)] 
Ignore editor backup files

6 years agoFix hSetBuffering004 to work with dynamic ghci
Ian Lynagh [Sun, 16 Jun 2013 19:23:49 +0000 (20:23 +0100)] 
Fix hSetBuffering004 to work with dynamic ghci

We need to actually consume the rest of stdin, or ghci will try
to interpret it as commands.

6 years agoFix hClose002 with the threaded RTS IO manager
Ian Lynagh [Sun, 16 Jun 2013 19:16:19 +0000 (20:16 +0100)] 
Fix hClose002 with the threaded RTS IO manager

If 'close fd' failed, then the MVars in the callbackTables would be
left empty, which caused deadlocks when we tried to 'take' them again.

Now we use 'finally' to ensure that they are refilled even if 'close'
throws an exception.

6 years agoUpdate GHC.ForeignPtr to use addCFinalizerToWeak#
Takano Akio [Thu, 18 Apr 2013 09:29:05 +0000 (18:29 +0900)] 
Update GHC.ForeignPtr to use addCFinalizerToWeak#

6 years agoFix a comment
Ian Lynagh [Sat, 15 Jun 2013 14:27:54 +0000 (15:27 +0100)] 
Fix a comment

6 years agoAdd setEnv/unsetEnv to System.Environment; fixes #7427
Ian Lynagh [Sat, 15 Jun 2013 11:46:21 +0000 (12:46 +0100)] 
Add setEnv/unsetEnv to System.Environment; fixes #7427

Patch from Simon Hengel.

6 years agoClarification what 'atomic' means here.
Edward Z. Yang [Fri, 14 Jun 2013 17:58:40 +0000 (10:58 -0700)] 
Clarification what 'atomic' means here.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agoOne more GHC.Err import eliminated
Simon Peyton Jones [Tue, 11 Jun 2013 21:07:26 +0000 (22:07 +0100)] 
One more GHC.Err import eliminated

(This one only shows up on Windows.)

6 years agoRevert "expose new Word operation to swap endianness for Word{16,32,64}"
Simon Peyton Jones [Tue, 11 Jun 2013 20:50:04 +0000 (21:50 +0100)] 
Revert "expose new Word operation to swap endianness for Word{16,32,64}"

This reverts commit 3ef0f91d4e9a3649581557ec4ba663db4306d7d5.

6 years agoFix some typos
Gabor Greif [Tue, 11 Jun 2013 21:37:02 +0000 (23:37 +0200)] 
Fix some typos

6 years agoexpose new Word operation to swap endianness for Word{16,32,64}
Ian Lynagh [Sun, 9 Jun 2013 11:01:22 +0000 (12:01 +0100)] 
expose new Word operation to swap endianness for Word{16,32,64}

Patch from Vincent Hanquez.

6 years agoUse atomicModifyIORef' rather than atomicModifyIORef
Ian Lynagh [Sat, 8 Jun 2013 20:35:53 +0000 (21:35 +0100)] 
Use atomicModifyIORef' rather than atomicModifyIORef

I don't know of any particular problems that this fixes, but as far as I
know it's not wrong, and it should be safer.

6 years agoReplace all atomicModifyIORef calls in GHC.Event.TimerManager
Ian Lynagh [Sat, 8 Jun 2013 20:10:08 +0000 (21:10 +0100)] 
Replace all atomicModifyIORef calls in GHC.Event.TimerManager

with atomicModifyIORef' calls. I'm not sure if it was causing any
problems, but I don't think there's any reason they couldn't be
strict, and it's safer this way.

6 years agoAdd a test for #7653
Ian Lynagh [Sat, 8 Jun 2013 20:09:59 +0000 (21:09 +0100)] 
Add a test for #7653

6 years agoIO manager: Edit the timeout queue directly, rather than using an edit list
Ian Lynagh [Sat, 8 Jun 2013 19:19:59 +0000 (20:19 +0100)] 
IO manager: Edit the timeout queue directly, rather than using an edit list

Fixes #7653.

6 years agoRemove uses of RecordWildCards in GHC.Event.TimerManager
Ian Lynagh [Sat, 8 Jun 2013 17:54:23 +0000 (18:54 +0100)] 
Remove uses of RecordWildCards in GHC.Event.TimerManager

6 years agoChange a use of atomicModifyIORef to atomicModifyIORef'
Ian Lynagh [Sat, 8 Jun 2013 16:06:13 +0000 (17:06 +0100)] 
Change a use of atomicModifyIORef to atomicModifyIORef'

Resulting core is unchanged.

6 years agoAdd an import to fix build ordering
Ian Lynagh [Fri, 7 Jun 2013 10:40:52 +0000 (11:40 +0100)] 
Add an import to fix build ordering

6 years agoFix import warnings
Ian Lynagh [Thu, 6 Jun 2013 17:07:21 +0000 (18:07 +0100)] 
Fix import warnings

6 years agoGHC.Err is no longer a boot module; no GHC/Err.lhs-boot
Simon Peyton Jones [Thu, 6 Jun 2013 13:37:20 +0000 (14:37 +0100)] 
GHC.Err is no longer a boot module; no GHC/Err.lhs-boot

6 years agoComments
Simon Peyton Jones [Thu, 6 Jun 2013 13:36:56 +0000 (14:36 +0100)] 
Comments

6 years agoMake GHC.Err depend on GHC.Integer
Simon Peyton Jones [Thu, 6 Jun 2013 13:36:44 +0000 (14:36 +0100)] 
Make GHC.Err depend on GHC.Integer

GHC relies internally on GCh.Integer.Type.mkInteger from integer-gmp,
but the dependency isn't visible to the build system, so we need to
add it here.

6 years agoRevert accidental change
Simon Peyton Jones [Thu, 6 Jun 2013 13:34:29 +0000 (14:34 +0100)] 
Revert accidental change

6 years agoRe-jig SOURCE imports
Simon Peyton Jones [Wed, 5 Jun 2013 17:01:54 +0000 (18:01 +0100)] 
Re-jig SOURCE imports

* Do not have have an hs-boot file for Data.Typeable
* Instead make all the loops go through
     GHC.Err (just a couple of magic functions)
     GHC.Exception (some non-exceptional functions)

The main idea is
  a) don't involve classes in the hs-boot world
  b) loop through error cases where performance doesn't matter
  c) be careful not to SOURCE import things that are bottom,
     unless MkCore knows about them in eRROR_IDS, so that we
     see their strictness

6 years agoRemove some unnecessary SOURCE imports
Ian Lynagh [Sun, 2 Jun 2013 11:47:28 +0000 (12:47 +0100)] 
Remove some unnecessary SOURCE imports

6 years agoRemove an import loop
Ian Lynagh [Sun, 2 Jun 2013 11:43:34 +0000 (12:43 +0100)] 
Remove an import loop

6 years agoAdd tests for kind-polymorphic Control.Category
Austin Seipp [Fri, 31 May 2013 17:17:46 +0000 (12:17 -0500)] 
Add tests for kind-polymorphic Control.Category

Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoRedo and cleanup the change replacing `unsafe*` with `toSing`
Iavor S. Diatchki [Fri, 31 May 2013 02:58:21 +0000 (19:58 -0700)] 
Redo and cleanup the change replacing `unsafe*` with `toSing`

6 years agoadd Foldable and Traversable instances for Either a and (,) a
Ross Paterson [Fri, 31 May 2013 01:25:57 +0000 (02:25 +0100)] 
add Foldable and Traversable instances for Either a and (,) a

Agreed in January 2011, but not implemented:

http://thread.gmane.org/gmane.comp.lang.haskell.libraries/15196
http://thread.gmane.org/gmane.comp.lang.haskell.libraries/17686
http://thread.gmane.org/gmane.comp.lang.haskell.libraries/19594

6 years agoRevert "Add code to convert from representation types, to existentially quantified...
Ian Lynagh [Thu, 30 May 2013 23:08:51 +0000 (00:08 +0100)] 
Revert "Add code to convert from representation types, to existentially quantified singletons."

This reverts commit f7fb908ad963f7180c30b55fba57a858b0391de4.

It causes a valdiate failure:

*** Core Lint errors : in result of Simplifier ***
<no location info>: Warning:
    In the expression: f_aqM
                         (x_aqF
                          `cast` (GHC.TypeLits.NTCo:SingI[0] <k_aKs> <n_aKt>
                                  :: GHC.TypeLits.SingI k_aKs n_aKt
                                       ~#
                                     GHC.TypeLits.Sing k_aKs n_aKt))
    From-type of Cast differs from type of enclosed expression
    From-type: GHC.TypeLits.SingI k_aKs n_aKt
    Type of enclosed expr: GHC.TypeLits.Sing k_aHe n_aHf
    Actual enclosed expr: x_aqF
    Coercion used in cast: GHC.TypeLits.NTCo:SingI[0] <k_aKs> <n_aKt>
*** Offending Program ***
[...]

6 years agoMerge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base
Iavor S. Diatchki [Thu, 30 May 2013 14:48:41 +0000 (07:48 -0700)] 
Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base

6 years agoEnable PolyKinds for Control.Category.
Austin Seipp [Thu, 30 May 2013 12:33:01 +0000 (07:33 -0500)] 
Enable PolyKinds for Control.Category.

This change will allow us to make various new things instances of
Category, such as promoted tuples.

Original discussion from libraries@haskell.org:

  http://www.haskell.org/pipermail/libraries/2012-August/018268.html

Fell off the radar. No complaints in the 2 week period since being
brought up again:

  http://www.haskell.org/pipermail/libraries/2013-May/019845.html

Patch from Edward Kmett (essentially.)

Authored-by: Edward Kmett <ekmett@gmail.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
6 years agoMerge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base
Iavor S. Diatchki [Mon, 27 May 2013 21:45:17 +0000 (14:45 -0700)] 
Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base

6 years agoAdd code to convert from representation types, to existentially quantified singletons.
Iavor S. Diatchki [Mon, 27 May 2013 21:44:59 +0000 (14:44 -0700)] 
Add code to convert from representation types, to existentially quantified singletons.

The basic idea is like this:

data SomeSing where SomeSing :: SingI n => Proxy n -> SomeSing

toSing :: Integer -> Maybe SomeSing  -- Maybe, so that we rejetc -ve numbers

The actual implementation is a bit more complicated because `SomeSing`
is actually parameterized by a kind, so we really have something akin
`SomeSing k`.  Also, `toSing` is a bit more general because, depending
on the kind, the representation is different.  For example, we also
support:

toSing :: String -> Maybe (SomeSing (KindParam :: KindIs Symbol))

This change relies on the primitive added to the compiler, which
converts `Sing` values into `SingI` dictionaries.

A nice benefit of this change is that, as far as I can see,
we don't need  `unsafeSinNat` and friends, so I removed them.

6 years agoMerge branch 'master' of http://darcs.haskell.org/packages/base
Ian Lynagh [Wed, 22 May 2013 00:19:00 +0000 (01:19 +0100)] 
Merge branch 'master' of darcs.haskell.org/packages/base

6 years agoAdd an __hsbase_ prefix to the MD5 symbols (#7914)
Simon Marlow [Tue, 21 May 2013 08:35:29 +0000 (09:35 +0100)] 
Add an __hsbase_ prefix to the MD5 symbols (#7914)

6 years agoAnother build ordering fix
Ian Lynagh [Mon, 20 May 2013 22:08:05 +0000 (23:08 +0100)] 
Another build ordering fix

6 years agoMore build ordering fixes
Ian Lynagh [Sun, 19 May 2013 16:48:03 +0000 (17:48 +0100)] 
More build ordering fixes

6 years agoFix build order when building with integer-simple
Ian Lynagh [Sun, 19 May 2013 15:35:40 +0000 (16:35 +0100)] 
Fix build order when building with integer-simple

The problem hasn't shown up with integer-gmp, but I can't see
why it couldn't happen in that case too.

6 years agoOmit T7773 on Msys
Simon Peyton Jones [Wed, 15 May 2013 16:46:25 +0000 (17:46 +0100)] 
Omit T7773 on Msys

Patch from Andreas Voellmy

6 years agoAdd comprehensive test for codepage encodings+recovery for them
Max Bolingbroke [Tue, 23 Apr 2013 18:15:02 +0000 (19:15 +0100)] 
Add comprehensive test for codepage encodings+recovery for them

6 years agoSupport for Windows DBCS and new SBCS with MultiByteToWideChar
Max Bolingbroke [Thu, 18 Apr 2013 20:29:08 +0000 (21:29 +0100)] 
Support for Windows DBCS and new SBCS with MultiByteToWideChar

Because MultiByteToWideChar/WideCharToMultiByte have a rather unhelpful
interface, we have to use a lot of binary searching tricks to get them
to match the iconv-like interface that GHC requires.

Even though the resulting encodings are slow, it does at least mean that we
now support all of Window's code pages. What's more, since these codecs are
basically only used for console output there probably won't be a huge volume
of text to deal with in the common case, so speed is less of a worry.

Note that we will still use GHC's faster table-based custom codec for supported
SBCSs.

6 years agoDerive Typeable for RealWorld and (->), now that we can
Jose Pedro Magalhaes [Tue, 7 May 2013 12:26:46 +0000 (13:26 +0100)] 
Derive Typeable for RealWorld and (->), now that we can

6 years agoUpdate parallel IO manager to handle the invalid files in the same way as previous...
Andreas Voellmy [Mon, 18 Mar 2013 02:27:49 +0000 (22:27 -0400)] 
Update parallel IO manager to handle the invalid files in the same way as previous IO manager.

This patch affects the IO manager using kqueue. See issue #7773. If the kqueue backend cannot wait for events on a file, it will simply call the registered callback for the file immediately. This is the behavior of the previous IO manager. This is not ideal, but it is an initial step toward dealing with the problem properly. Ideally, we would use a non-kqueue mechanism for waiting on files (select seems most reliable) that cannot be waited on with kqueue.

6 years agoFix build on Windows
Ian Lynagh [Sat, 27 Apr 2013 22:43:08 +0000 (23:43 +0100)] 
Fix build on Windows

6 years agoAdd isLeft/isRight
Simon Hengel [Tue, 25 Dec 2012 15:07:27 +0000 (16:07 +0100)] 
Add isLeft/isRight

6 years agoImprove documentation for mkTextEncoding
Max Bolingbroke [Tue, 23 Apr 2013 18:15:40 +0000 (19:15 +0100)] 
Improve documentation for mkTextEncoding

6 years agoTest fix for #7853
Max Bolingbroke [Mon, 22 Apr 2013 20:23:49 +0000 (21:23 +0100)] 
Test fix for #7853

6 years agoFix #7853
Max Bolingbroke [Mon, 22 Apr 2013 20:23:07 +0000 (21:23 +0100)] 
Fix #7853

6 years agoAdd Debug.Trace.{traceId,traceShowId,traceM,traceShowM}; fixes #7626
Ian Lynagh [Sun, 21 Apr 2013 21:35:50 +0000 (22:35 +0100)] 
Add Debug.Trace.{traceId,traceShowId,traceM,traceShowM}; fixes #7626

6 years agoAdd some more Data.Functor functions; fixes #7817
Ian Lynagh [Sun, 21 Apr 2013 20:46:07 +0000 (21:46 +0100)] 
Add some more Data.Functor functions; fixes #7817

Added infixl4 $>.
Re-exported void from Data.Functor.
Also defined the fixity for <$ for non-GHC impls.

6 years agoFix warnings
Ian Lynagh [Sun, 21 Apr 2013 17:56:38 +0000 (18:56 +0100)] 
Fix warnings

6 years agoBuild fix for iOS; fixes #7759
Ian Lynagh [Sun, 21 Apr 2013 17:07:58 +0000 (18:07 +0100)] 
Build fix for iOS; fixes #7759

Patch from Stephen Blackheath.

The issue here is that the #defines EVFILT_READ and EVFILT_WRITE have
the values -1 and -2. The original code translates that to
filterRead = Filter -1 which is wrong Haskell and fails to compile.
The modified code produces the correct code filterRead = Filter (-1)

6 years agoImplement faster System.Timeout.timeout for the threaded RTS.
Bertram Felgenhauer [Thu, 7 Mar 2013 01:19:28 +0000 (02:19 +0100)] 
Implement faster System.Timeout.timeout for the threaded RTS.

The basic idea is to use the Timer Manager rather than spawning an
auxilliary thread to handle timeouts; this was proposed by Bas van Dijk
two years ago (#4963), and recently by Herbert Valerio. The key idea
to make this work is to spawn an auxilliary thread for the delivery
of the Timeout exception. This idea as well as most of the code is due
to Akio Takano.

6 years agoFix System.Timeout.timeout leaking Timeout exceptions (#7719).
Bertram Felgenhauer [Thu, 7 Mar 2013 01:18:17 +0000 (02:18 +0100)] 
Fix System.Timeout.timeout leaking Timeout exceptions (#7719).