packages/base.git
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).

6 years agoadd test for #7719
Bertram Felgenhauer [Sat, 20 Apr 2013 18:19:54 +0000 (20:19 +0200)] 
add test for #7719

6 years agothrowTo is interruptible.
Edward Z. Yang [Tue, 16 Apr 2013 21:20:41 +0000 (14:20 -0700)] 
throwTo is interruptible.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agomd5.c: fix a typo in the size argument of memset
Michal Terepeta [Tue, 16 Apr 2013 07:15:36 +0000 (09:15 +0200)] 
md5.c: fix a typo in the size argument of memset

6 years agoAdd test for #7522
Max Bolingbroke [Wed, 10 Apr 2013 20:25:05 +0000 (21:25 +0100)] 
Add test for #7522

6 years agoFix #7522 by checking for empty byte buffers a little more
Max Bolingbroke [Wed, 10 Apr 2013 20:13:28 +0000 (21:13 +0100)] 
Fix #7522 by checking for empty byte buffers a little more

Quite a few lines have changed but that is mostly comments.

6 years agoDon't just fail if hGetBufSome is used on a non-FD: fall back on the slow path instead
Max Bolingbroke [Sun, 24 Mar 2013 13:04:58 +0000 (13:04 +0000)] 
Don't just fail if hGetBufSome is used on a non-FD: fall back on the slow path instead

6 years agoUse correct type for poll on Mac/FreeBSD, fixes ticket #7714.
Edward Z. Yang [Sun, 10 Mar 2013 09:51:08 +0000 (01:51 -0800)] 
Use correct type for poll on Mac/FreeBSD, fixes ticket #7714.

Thanks Kazu Yamamoto for submitting this patch.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
6 years agoRemove some functions deprecated since GHC 7.2.
Ian Lynagh [Fri, 1 Mar 2013 14:02:24 +0000 (14:02 +0000)] 
Remove some functions deprecated since GHC 7.2.

6 years agoMerge branch 'master' into rule_fixes
Daniel Fischer [Wed, 27 Feb 2013 13:53:29 +0000 (14:53 +0100)] 
Merge branch 'master' into rule_fixes

6 years agoTypo
Gabor Greif [Mon, 25 Feb 2013 15:32:47 +0000 (16:32 +0100)] 
Typo

6 years agoFix documentation
shelarcy [Sat, 23 Feb 2013 09:32:24 +0000 (18:32 +0900)] 
Fix documentation

Signed-off-by: Gabor Greif <ggreif@gmail.com>
6 years agoRemove blocked (deprecated since 7.2)
Ian Lynagh [Tue, 19 Feb 2013 19:21:25 +0000 (19:21 +0000)] 
Remove blocked (deprecated since 7.2)

6 years agoRemove block and unblock (deprecated since GHC 7.0)
Ian Lynagh [Tue, 19 Feb 2013 17:50:11 +0000 (17:50 +0000)] 
Remove block and unblock (deprecated since GHC 7.0)

6 years agoRemove some always-true CPP tests from System.IO.Error
Ian Lynagh [Sun, 17 Feb 2013 18:42:55 +0000 (18:42 +0000)] 
Remove some always-true CPP tests from System.IO.Error

If
    defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
was False then compilation would have failed anyway, e.g. due to a
missing definition for annotateIOError.

6 years agoRemove a redundant backwards compatibility hack
Ian Lynagh [Sun, 17 Feb 2013 18:33:41 +0000 (18:33 +0000)] 
Remove a redundant backwards compatibility hack

6 years agoDefine Functor instances for ArgOrder, OptDescr and ArgDescr
Bas van Dijk [Mon, 19 Nov 2012 15:09:02 +0000 (16:09 +0100)] 
Define Functor instances for ArgOrder, OptDescr and ArgDescr

6 years agoMerge branch 'master' into rule_fixes
Daniel Fischer [Sun, 17 Feb 2013 16:24:20 +0000 (17:24 +0100)] 
Merge branch 'master' into rule_fixes

6 years agoGive Control.Monad.Instances a proper DEPRECATED pragma
Ian Lynagh [Sat, 16 Feb 2013 13:47:41 +0000 (13:47 +0000)] 
Give Control.Monad.Instances a proper DEPRECATED pragma

6 years agoRemove some things deprecated since GHC 7.2
Ian Lynagh [Sat, 16 Feb 2013 12:32:53 +0000 (12:32 +0000)] 
Remove some things deprecated since GHC 7.2

7.2 is too old even to build HEAD, so seems reasonable to remove them
now.

6 years agoRemove DEPRECATED pragmas from a couple of tests
Ian Lynagh [Sat, 16 Feb 2013 01:01:53 +0000 (01:01 +0000)] 
Remove DEPRECATED pragmas from a couple of tests

They don't seem to server any purpose, and gave false positives
when grepping for deprecated things

6 years agoMark DEPRECATED pragmas with when they were added
Ian Lynagh [Sat, 16 Feb 2013 00:43:14 +0000 (00:43 +0000)] 
Mark DEPRECATED pragmas with when they were added

6 years agoRemove nhc98-specific files and content
Ian Lynagh [Fri, 15 Feb 2013 20:51:56 +0000 (20:51 +0000)] 
Remove nhc98-specific files and content

6 years agoMerge branch 'master' of http://darcs.haskell.org/packages/base
Simon Peyton Jones [Fri, 15 Feb 2013 17:22:08 +0000 (17:22 +0000)] 
Merge branch 'master' of darcs.haskell.org/packages/base

6 years agoAdd the IsList class, for OverloadedLists
Simon Peyton Jones [Fri, 15 Feb 2013 17:21:54 +0000 (17:21 +0000)] 
Add the IsList class, for OverloadedLists

6 years agoRemove uses of compose(s) in tests
Ian Lynagh [Thu, 14 Feb 2013 14:47:23 +0000 (14:47 +0000)] 
Remove uses of compose(s) in tests

6 years agoenable memo001/memo002 when fast
Simon Marlow [Thu, 14 Feb 2013 10:55:57 +0000 (10:55 +0000)] 
enable memo001/memo002 when fast

6 years agobase: use --host as target, not uname
Sergei Trofimovich [Wed, 13 Feb 2013 20:25:24 +0000 (23:25 +0300)] 
base: use --host as target, not uname

Fixed bootstrap failure on linux for --target=mingw32

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
6 years agoUse fromException instead of cast when matching exceptions
Simon Marlow [Thu, 7 Feb 2013 09:00:22 +0000 (09:00 +0000)] 
Use fromException instead of cast when matching exceptions

Since I added the SomeAsyncException class, we weren't calling the
StackOverflowHook() properly for stack overflows, because this bit of
code was not expecting the extra layer in the hierarchy.

6 years agoMake 'length' into a good consumer, fixing Trac #876
Simon Peyton Jones [Thu, 14 Feb 2013 08:22:08 +0000 (08:22 +0000)] 
Make 'length' into a good consumer, fixing Trac #876

Trac #876 is the oldest ticket I have fixed in a long time.
I finally figured out how to make foldr behave in a non
space-leaky way for length.

Thanks to Andy for re-opening.

6 years agoChange rules for RealFrac methods to pointfree, so that they can also fire in pointfr...
Daniel Fischer [Wed, 13 Feb 2013 15:10:12 +0000 (16:10 +0100)] 
Change rules for RealFrac methods to pointfree, so that they can also fire in pointfree use.

6 years agoAdd isNewtype to GHC.Generics (FIX #7631)
Jose Pedro Magalhaes [Wed, 13 Feb 2013 10:40:28 +0000 (10:40 +0000)] 
Add isNewtype to GHC.Generics (FIX #7631)

6 years agoExport Proxy from Data.Typeable
Jose Pedro Magalhaes [Tue, 12 Feb 2013 10:12:16 +0000 (10:12 +0000)] 
Export Proxy from Data.Typeable

6 years agoOnly run dynamic004 with optimisation
Jose Pedro Magalhaes [Tue, 12 Feb 2013 10:08:55 +0000 (10:08 +0000)] 
Only run dynamic004 with optimisation

This is because the new kind-polymorphic Typeable seems to
require optimisation to deal with typeRep operations on
(extremely) large types.

6 years agoImplement poly-kinded Typeable
Jose Pedro Magalhaes [Thu, 7 Feb 2013 13:51:19 +0000 (13:51 +0000)] 
Implement poly-kinded Typeable

This patch makes the Data.Typeable.Typeable class work with arguments of any
kind. In particular, this removes the Typeable1..7 class hierarchy, greatly
simplyfing the whole Typeable story. Also added is the AutoDeriveTypeable
language extension, which will automatically derive Typeable for all types and
classes declared in that module. Since there is now no good reason to give
handwritten instances of the Typeable class, those are ignored (for backwards
compatibility), and a warning is emitted.

The old, kind-* Typeable class is now called OldTypeable, and lives in the
Data.OldTypeable module. It is deprecated, and should be removed in some future
version of GHC.

6 years agoMerge the new parallel I/O manager
Johan Tibell [Tue, 12 Feb 2013 06:42:21 +0000 (22:42 -0800)] 
Merge the new parallel I/O manager

6 years agoFix bug that caused ghci to create a large number of kqueues and pipes on OS X.
Andreas Voellmy [Sun, 10 Feb 2013 23:06:37 +0000 (15:06 -0800)] 
Fix bug that caused ghci to create a large number of kqueues and pipes on OS X.

This is caused because ensureIOManagerIsRunning is repeatedly called and this was initializing new IO managers on each call. Fixed so that a new manager is not created if one already exists.

6 years agoAdding a comment about the workaround of the parallel IO manager on Mac.
Kazu Yamamoto [Fri, 8 Feb 2013 07:24:26 +0000 (16:24 +0900)] 
Adding a comment about the workaround of the parallel IO manager on Mac.

6 years agoRemoving unnecessary trailing spaces.
Kazu Yamamoto [Fri, 8 Feb 2013 07:17:57 +0000 (16:17 +0900)] 
Removing unnecessary trailing spaces.

6 years agoWorkaround buggy kqueue on os x.
Andreas Voellmy [Fri, 8 Feb 2013 05:47:46 +0000 (00:47 -0500)] 
Workaround buggy kqueue on os x.

On OS X, set haveOneShot = False and always wakeup the manager after a fd is registered.

6 years agoEliminate use of kevent64() calls.
Andreas Voellmy [Thu, 7 Feb 2013 19:15:21 +0000 (14:15 -0500)] 
Eliminate use of kevent64() calls.

kevent64() is only available on OS X. It appears to be buggy, so we use kevent() instead, which is also available on FreeBSD.

6 years agoRemoved unnecessary import from GHC.Event.Thread.
Andreas Voellmy [Thu, 7 Feb 2013 19:14:30 +0000 (14:14 -0500)] 
Removed unnecessary import from GHC.Event.Thread.

6 years agoAdded NOINLINE directive to the numEnabledEventManagers IORef in GHC.Event.Thread.
Andreas Voellmy [Tue, 8 Jan 2013 02:43:39 +0000 (21:43 -0500)] 
Added NOINLINE directive to the numEnabledEventManagers IORef in GHC.Event.Thread.

6 years agoAdded UNPACK to emLock in GHC.Event.Manager Manager datatype.
Andreas Voellmy [Tue, 8 Jan 2013 02:37:58 +0000 (21:37 -0500)] 
Added UNPACK to emLock in GHC.Event.Manager Manager datatype.

6 years agoAdd some commentary in GHC.Event.Manager to the explain the poll loop.
Andreas Voellmy [Tue, 8 Jan 2013 01:04:36 +0000 (20:04 -0500)] 
Add some commentary in GHC.Event.Manager to the explain the poll loop.

6 years agoUse (.&.) instead of mod in GHC.Event.Manager since the modulus is a power of 2.
Andreas Voellmy [Tue, 8 Jan 2013 00:44:31 +0000 (19:44 -0500)] 
Use (.&.) instead of mod in GHC.Event.Manager since the modulus is a power of 2.

6 years agoioManagerCapabilitiesChanged takes no arguments and instead gets the current enabled...
Andreas Voellmy [Mon, 7 Jan 2013 18:34:06 +0000 (13:34 -0500)] 
ioManagerCapabilitiesChanged takes no arguments and instead gets the current enabled number of capabilities by executing getNumCapabilities after it acquires a lock on the IO managers array.

6 years agoFix wrong type in FFI call to eventfd_write in GHC.Event.Control.
Andreas Voellmy [Fri, 4 Jan 2013 16:00:22 +0000 (11:00 -0500)] 
Fix wrong type in FFI call to eventfd_write in GHC.Event.Control.

6 years agoAvoid conditional compilation in GHC.Event.Manager.
Andreas Voellmy [Fri, 4 Jan 2013 15:51:00 +0000 (10:51 -0500)] 
Avoid conditional compilation in GHC.Event.Manager.

Use ordinary Bool value to distinguish between backends supporting oneShot mode and eliminate several uses of conditional compilation in favor of ordinary conditional expressions using this Bool value. The benefit of this change is that more of the code compiles on more of the platforms.

6 years agoUndo recent change to the type of GHC.Event.Thread.getSystemEventManager and update...
Andreas Voellmy [Fri, 4 Jan 2013 15:34:32 +0000 (10:34 -0500)] 
Undo recent change to the type of GHC.Event.Thread.getSystemEventManager and update the commentary on this function.

6 years agocloseFdWith invokes callbacks only after the fd is closed.
Andreas Voellmy [Fri, 4 Jan 2013 15:12:58 +0000 (10:12 -0500)] 
closeFdWith invokes callbacks only after the fd is closed.

Move callback invocation to after close. close must be run after the all backends are updated. Therefore the sequence is to update the backends, in the process getting the callbacks to invoke (actually just getting an IO action which when executed will execute the callbacks), call close, and finally update the Managers' callback tables for the fd and execute the callbacks.

6 years agoTidy up GHC.Event.Thread.closeFdWith.
Andreas Voellmy [Fri, 4 Jan 2013 15:01:02 +0000 (10:01 -0500)] 
Tidy up GHC.Event.Thread.closeFdWith.

6 years agocloseFdWith closes fd after unregistering the fd with the backend.
Andreas Voellmy [Fri, 4 Jan 2013 14:54:50 +0000 (09:54 -0500)] 
closeFdWith closes fd after unregistering the fd with the backend.

In closeFdWith moved closing of fd after calling closeFd_ on each capabilities manager, ensuring that the fd is still valid when the fd is deregistered with the backend.

6 years agoUpdate closeFd_ to avoid unnecessary backend modifications.
Andreas Voellmy [Fri, 4 Jan 2013 14:47:37 +0000 (09:47 -0500)] 
Update closeFd_ to avoid unnecessary backend modifications.

This makes closeFd follow the patten of closeFd_.

6 years agoChange GHC.Event.Manager.closeFd to unregister interest in the file with the backend.
Andreas Voellmy [Fri, 4 Jan 2013 12:17:29 +0000 (07:17 -0500)] 
Change GHC.Event.Manager.closeFd to unregister interest in the file with the backend.

The file must not be closed when unregistering interest in the file with the backend, because otherwise the backend will likely encounter an error (invalid fd). Therefore, the close fd command is executed after the backend is updated.

6 years agoAvoid use of backend modifyFdOnce in Poll backend in unregisterFd_.
Andreas Voellmy [Fri, 4 Jan 2013 03:39:34 +0000 (22:39 -0500)] 
Avoid use of backend modifyFdOnce in Poll backend in unregisterFd_.

6 years agoAdded missing wakeup in GHC.Event.Manager.closeFd_.
Andreas Voellmy [Thu, 3 Jan 2013 17:20:53 +0000 (18:20 +0100)] 
Added missing wakeup in GHC.Event.Manager.closeFd_.

This missing wakeup may have affected the IO manager when used with the poll backend.

6 years agoImprove comment on GHC.Event.Manager.closeFd_.
Andreas Voellmy [Thu, 3 Jan 2013 17:18:36 +0000 (18:18 +0100)] 
Improve comment on GHC.Event.Manager.closeFd_.

Making this comment stand alone and not reference the comment on closeFd.

6 years agorefactoring with guard.
Kazu Yamamoto [Fri, 28 Dec 2012 03:54:03 +0000 (12:54 +0900)] 
refactoring with guard.

6 years agominor refactoring.
Kazu Yamamoto [Fri, 28 Dec 2012 03:51:32 +0000 (12:51 +0900)] 
minor refactoring.

6 years agoMaking KQueue.poll similar to EPoll.poll.
Kazu Yamamoto [Fri, 28 Dec 2012 03:48:01 +0000 (12:48 +0900)] 
Making KQueue.poll similar to EPoll.poll.

6 years agorenaming parameters.
Kazu Yamamoto [Fri, 28 Dec 2012 03:32:01 +0000 (12:32 +0900)] 
renaming parameters.

6 years agoRenaming QueueFd to KQueueFd.
Kazu Yamamoto [Fri, 28 Dec 2012 03:29:46 +0000 (12:29 +0900)] 
Renaming QueueFd to KQueueFd.

6 years agorenaming EventQueue to KQueue.
Kazu Yamamoto [Fri, 28 Dec 2012 03:28:41 +0000 (12:28 +0900)] 
renaming EventQueue to KQueue.