summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* Specialise monad functions, and make them INLINEABLESimon Peyton Jones2014-08-281-0/+38
| | | | | Specialise liftM, foldM, etc, and make them specialisable for new monads at their call sites by using INLINEABLE
* Slightly improve fusion rules for 'take'Simon Peyton Jones2014-08-281-3/+10
|
* Move the Enum Word instance into GHC.EnumSimon Peyton Jones2014-08-282-24/+36
| | | | | This just avoids an unnecessary orphan instance. All the other instances for "earlier" types are in GHC.Enum already.
* Specialise Eq, Ord, Read, Show at Int, Char, StringSimon Peyton Jones2014-08-283-1/+11
| | | | | These instances are quite common, so it's good to have pre-specialised versions available
* Revert "rts/base: Fix #9423"Austin Seipp2014-08-224-25/+20
| | | | | | | | | This should fix the Windows fallout, and hopefully this will be fixed once that's sorted out. This reverts commit f9f89b7884ccc8ee5047cf4fffdf2b36df6832df. Signed-off-by: Austin Seipp <austin@well-typed.com>
* submodule update hpc/stm with gitignore.Edward Z. Yang2014-08-222-0/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Update a comment in base cbitsReid Barton2014-08-201-1/+1
|
* rts/base: Fix #9423Andreas Voellmy2014-08-194-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix #9423. The problem in #9423 is caused when code invoked by `hs_exit()` waits on all foreign calls to return, but some IO managers are in `safe` foreign calls and do not return. The previous design signaled to the timer manager (via its control pipe) that it should "die" and when the timer manager returned to Haskell-land, the Haskell code in timer manager then signalled to the IO manager threads that they should return from foreign calls and `die`. Unfortunately, in the shutdown sequence the timer manager is unable to return to Haskell-land fast enough and so the code that signals to the IO manager threads (via their control pipes) is never executed and the IO manager threads remain out in the foreign calls. This patch solves this problem by having the RTS signal to all the IO manager threads (via their control pipes; and in addition to signalling to the timer manager thread) that they should shutdown (in `ioManagerDie()` in `rts/Signals.c`. To do this, we arrange for each IO manager thread to register its control pipe with the RTS (in `GHC.Thread.startIOManagerThread`). In addition, `GHC.Thread.startTimerManagerThread` registers its control pipe. These are registered via C functions `setTimerManagerControlFd` (in `rts/Signals.c`) and `setIOManagerControlFd` (in `rts/Capability.c`). The IO manager control pipe file descriptors are stored in a new field of the `Capability_ struct`. Test Plan: See the notes on #9423 to recreate the problem and to verify that it no longer occurs with the fix. Auditors: simonmar Reviewers: simonmar, edsko, ezyang, austin Reviewed By: austin Subscribers: phaskell, simonmar, ezyang, carter, relrod Differential Revision: https://phabricator.haskell.org/D129 GHC Trac Issues: #9423, #9284
* Mention that `Data.Ix` uses row-major indexingAlexander Berntsen2014-08-191-1/+1
| | | | | | | This addresses Trac #8712 by simply mentioning row-major indexing, thereby removing any ambiguity. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Make Prelude.signum handle -0.0 correctly (#7858)Alexander Berntsen2014-08-182-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make the `Float` and `Double` implementations of `signum` handle -0.0 correctly per IEEE-754. This, together with "Make Prelude.abs handle -0.0 correctly (#7858)", fixes Trac #7858. Depends on D145 Signed-off-by: Alexander Berntsen <alexander@plaimi.net> Test Plan: signum of (-0.0) should be (-0.0) not 0.0. Test program: main = putStrLn $ p ++ " " ++ n where f = show . signum p = f (-0.0 :: Double) n = f (0.0 :: Double) Reviewers: ekmett, hvr, rwbarton, austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D148 GHC Trac Issues: #7858
* Make Prelude.abs handle -0.0 correctly (#7858)Alexander Berntsen2014-08-182-4/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: Make the `Float` and `Double` implementations of `abs` handle -0.0 correctly per IEEE-754. abs (-0.0::Float) and abs (-0.0::Double) previously returned -0.0, when they should return 0.0. This patch fixes this. Signed-off-by: Alexander Berntsen <alexander@plaimi.net> Test Plan: abs (-0.0::Double) should = 0.0 instead of (-0.0) Reviewers: ekmett, hvr, austin, rwbarton Reviewed By: austin, rwbarton Subscribers: phaskell, trofi, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D145 GHC Trac Issues: #7858
* Fix broken link in Data.Data to SYB home page (Trac #9455)Simon Peyton Jones2014-08-181-9/+9
| | | | | Ralf Laemmel's page has disappeared, so I made it point to the Haskell Wiki page instead.
* Workaround GCC `__ctzdi2` intrinsic linker errorsHerbert Valerio Riedel2014-08-171-1/+17
| | | | | | | | | | | | | | | | | | | | | | | On Linux/i386 the 64bit `__builtin_ctzll()` instrinsic doesn't get inlined by GCC but rather a short `__ctzdi2` runtime function is inserted when needed into compiled object files. This causes failures for the four test-cases TEST="T8639_api T8628 dynCompileExpr T5313" with error messages of the kind dynCompileExpr: .../libraries/ghc-prim/dist-install/build/libHSghcpr_BE58KUgBe9ELCsPXiJ1Q2r.a: unknown symbol `__ctzdi2' dynCompileExpr: dynCompileExpr: unable to load package `ghc-prim' This workaround forces GCC on 32bit x86 to to express `hs_ctz64` in terms of the 32bit `__builtin_ctz()` (this is no loss, as there's no 64bit BSF instruction on i686 anyway) and thus avoid the problematic out-of-line runtime function. Note: `__builtin_ctzll()` is used since e0c1767d0ea8d12e0a4badf43682a08784e379c6 (re #9340)
* Implement new CLZ and CTZ primops (re #9340)Herbert Valerio Riedel2014-08-143-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | This implements the new primops clz#, clz32#, clz64#, ctz#, ctz32#, ctz64# which provide efficient implementations of the popular count-leading-zero and count-trailing-zero respectively (see testcase for a pure Haskell reference implementation). On x86, NCG as well as LLVM generates code based on the BSF/BSR instructions (which need extra logic to make the 0-case well-defined). Test Plan: validate and succesful tests on i686 and amd64 Reviewers: rwbarton, simonmar, ezyang, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D144 GHC Trac Issues: #9340
* testsuite/base: update .gitignoreAustin Seipp2014-08-111-0/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Improve seq documentation; part of trac issue #9390Michael Snoyman2014-08-101-0/+7
| | | | | | | | | | | | | | | | Summary: Signed-off-by: Michael Snoyman <michael@snoyman.com> Test Plan: Review documentation change Reviewers: simonpj, austin Reviewed By: austin Subscribers: phaskell, hvr, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D136 GHC Trac Issues: #9390
* change topHandler02/topHandler03 tests to use signal_exit_code functionKarel Gardas2014-08-101-3/+2
| | | | | | | | | | | | Test Plan: validate Reviewers: simonmar, austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D127
* Remove obsolete "-- #hide" Haddock pragmasReid Barton2014-08-092-2/+0
| | | | The modules already have the modern version {-# OPTIONS_HADDOCK hide #-}.
* Tweak Haddock in GHC.TypesReid Barton2014-08-091-2/+2
|
* Tweak Haddock markup in GHC.MagicReid Barton2014-08-091-6/+6
|
* Implement the final change to INCOHERENT from Trac #9242Simon Peyton Jones2014-08-081-20/+17
| | | | | | | | | | | | | | | | The change here is to make INCOHERENT slightly more permissive: if the selected candidate is incoherent then ignore all unifying candidates This allows us to move the {-# INCOHERENT #-} pragma from from instance Typeable (f a) to Typeable (n:Nat) and Typable (s:Symbol) where it belongs, and where Trac #9242 said it should be. I don't think this will affect anyone. I've updated the user manual.
* Filter out null bytes from trace, and warn accordingly, fixing #9395.Edward Z. Yang2014-08-054-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, if you ran trace "foo\0bar", the output was truncated so that everything after the null byte was omitted. This was terrible. Now we filter out null bytes, and emit an extra trace saying that null bytes were filtered out. NB: we CANNOT fix debugBelch, because all printf variants *always* respect null bytes, even if you're using string precision such as %.*s. The alternative would have been to introduce a new function debugRawBelch which did not use format strings and took an explicit string length, but I decided we generally should avoid putting null bytes in our trace messages, and warn the user. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D121 GHC Trac Issues: #9395
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-057-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* fix topHandler03 execution on Solaris where shell signals SIGTERM correctlyKarel Gardas2014-08-041-1/+2
| | | | | | | | | | | | | | | | Summary: This patch fixes topHandler03 execution on Solaris where shell correctly signals SIGTERM as exit status 15. Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D112
* fix openFile003 test on Solaris/i386 (platform output is not needed anymore)Karel Gardas2014-08-041-4/+0
| | | | | | | | | | | | Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D114
* ghc --make: add nicer names to RTS threads (threaded IO manager, make workers)Sergei Trofimovich2014-08-041-2/+6
| | | | | | | | | | | | | | | | | | | | Summary: The patch names most of RTS threads and ghc (the tool) threads. It makes nicer debug and eventlog output for ghc itself. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: ran debugged ghc under '+RTS -Ds' Reviewers: simonmar, austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D101
* Add comments about the {-# INCOHERENT #-} for Typeable (f a)Simon Peyton Jones2014-07-311-2/+20
| | | | C.f. Trac #9242
* Fix validate falloutAustin Seipp2014-07-281-1/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* base: make System.IO.openTempFile generate less predictable namesSergei Trofimovich2014-07-281-8/+16
| | | | | | | | | | | | | | | | | It basically changes prefix ++ getpid() ++ seq_no ++ suffix for prefix ++ rand() ++ rand() ++ suffix Which make any call to 'openTempFile' finish without loops. Bug-report: https://ghc.haskell.org/trac/ghc/ticket/9058 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add Functor, Applicative, Monad instances for First, LastBen Gamari2014-07-282-1/+24
| | | | | | | | | | | | | | | | | | | Summary: This was proposed in 2011 [1] with no serious objections although wasn't implemented until it was again mentioned in 2014 [2]. [1] http://www.haskell.org/pipermail/libraries/2011-January/015552.html [2] http://www.haskell.org/pipermail/libraries/2014-June/023228.html Test Plan: None Reviewers: austin Reviewed By: austin Subscribers: hvr, phaskell, simonmar, relrod, carter, ekmett Differential Revision: https://phabricator.haskell.org/D81
* use GHC-7.8.3's values for thread block reason (fixes #9333)Jost Berthold2014-07-281-7/+11
| | | | | | | | | | | | | | | | | | | | Summary: For now, BlockedOnMVar and BlockedOnMVarRead are not distinguished. Making the distinction would mean to change an exported datatype (API change). Code for this change is included but commented out. The patch adds a test for the threadstatus, which retrieves status BlockedOnMVar for two threads blocked on writing and reading an MVar. Test Plan: ran validate, including the new test Reviewers: simonmar, austin, ezyang Reviewed By: austin, ezyang Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D83
* Avoid to pass a socket to setmode/isatty in WindowsIsamu Mogi2014-07-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: In Windows, a socket is not a file descriptor. So passing it to setmode/isatty causes an error that returns EABF and triggers invalid parameter handler. Test Plan: 1. Add WinDbg as a postmortem debugger (C:\>windbg -I) 2. Pass a socket to GHC.IO.Device.IODevice.isTerminal / GHC.IO.FD.fdToHandle' (Executing 'cabal update' calls each functions with the socket in cabal-install 1.20.0.1) 3. WinDbg pops up and outputs error message: "Invalid parameter passed to C runtime function." 4. Apply the patch 5. Redo step 2 6. WinDbg doesn't pop up Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D92
* Module reexports, fixing #8407.Edward Z. Yang2014-07-252-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The general approach is to add a new field to the package database, reexported-modules, which considered by the module finder as possible module declarations. Unlike declaring stub module files, multiple reexports of the same physical package at the same name do not result in an ambiguous import. Has submodule updates for Cabal and haddock. NB: When a reexport renames a module, that renaming is *not* accessible from inside the package. This is not so much a deliberate design choice as for implementation expediency (reexport resolution happens only when a package is in the package database.) TODO: Error handling when there are duplicate reexports/etc is not very well tested. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Conflicts: compiler/main/HscTypes.lhs testsuite/.gitignore utils/haddock
* Ignore tix files.Edward Z. Yang2014-07-231-0/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Make last a good consumerJoachim Breitner2014-07-221-5/+2
| | | | | | | | | | | | | | | | | | Summary: Make last a good consumer simply by implementing it as foldl. This fixes Trac: #9339. Thanks to David Feuer for bringing it up. Test Plan: perf/should_run/T9339 + general validation Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D86 Trac Issues: #9339
* Update Cabal submodule to HEAD (1.21)Edward Z. Yang2014-07-212-1/+1
| | | | This reverts commit f23b2129aca24beb4ece0d5915f67c448dc64ae4.
* Data.List: Unterse/Obvious comment regarding CPPAlexander Berntsen2014-07-201-1/+1
| | | | | | | | | | | | Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D77
* Add PolyKinds extension to Data.MonoidAlexander Berntsen2014-07-202-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Carl Howells pointed out[0] that the `Monoid` instance for `Data.Proxy.Proxy` is only defined for types with kind *. This is a very mild change. Furthermore, Edward Kmett revealed[1] that it was supposed to be there all along -- the extension simply got lost in commit 1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11, as pointed out by Adam Vogt[2]. This used to be correct in GHC 7.6, so this commit fixes a regression. This addresses #9317. [0] <http://www.haskell.org/pipermail/libraries/2014-July/023261.html>. [1] <http://www.haskell.org/pipermail/libraries/2014-July/023267.html>. [2] <http://www.haskell.org/pipermail/libraries/2014-July/023265.html>. Signed-off-by: Alexander Berntsen <alexander@plaimi.net> Test Plan: See [0] Reviewers: austin, hvr, ekmett Reviewed By: austin, hvr, ekmett Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D70
* Revert "Update Cabal submodule to HEAD (1.21)"Edward Z. Yang2014-07-202-1/+1
| | | | | This reverts commit af28e61c7e84b8eb89fdfd9671af83a2a13f554a. We'll wait until it's possible to bootstrap from 7.6 out of the box.
* Update Cabal submodule to HEAD (1.21)Edward Z. Yang2014-07-182-1/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* integer-gmp: tweak gitignore.Austin Seipp2014-07-121-0/+3
| | | | | | Auditors: hvr Signed-off-by: Austin Seipp <austin@well-typed.com>
* Integrate changelog entries from base-4.7.0.1 relHerbert Valerio Riedel2014-07-111-0/+13
|
* Fix typos in base documentation.Shachaf Ben-Kiki2014-07-102-4/+4
| | | | | | | | | | | | | | Summary: Signed-off-by: Shachaf Ben-Kiki <shachaf@gmail.com> Test Plan: n/a Reviewers: austin Reviewed By: austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D57
* GHC.Conc: clarify that 'forkOn' binds to capability, not a 'CPU' or 'Task'Sergei Trofimovich2014-07-101-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Capability (HEC) can migrate to other Task (thus switch CPU) unless capability was created as a bound haskell thread. Task also can migrate to other CPU due to OS scheduler (unless '-qa' RTS option is set). Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: proofread for typos Reviewers: simonmar, austin Reviewed By: austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D52
* Track gitignore update in submodule unixEdward Z. Yang2014-07-071-0/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix imports in GHC.Event.Poll when not HAVE_POLL_H (#9275)Reid Barton2014-07-061-0/+1
| | | | | | Though as far as I can tell, we can never successfully build under this configuration anyways: GHC.Event.TimerManager requires the Poll backend to be functional.
* Update transformers submodule to 0.4.1.0 releaseHerbert Valerio Riedel2014-07-021-0/+0
|
* reading/writing blocking FDs over FD_SETSIZE is broken (Partially Trac #9169)Sergei Trofimovich2014-07-021-1/+5
| | | | | | | | | | | | | | | | | | Summary: libraries/base/cbits/inputReady.c had no limits on file descriptors. Add a limit as non-threaded RTS does. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: none Reviewers: austin, simonmar Reviewed By: austin, simonmar Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D28
* Re-add more primops for atomic ops on byte arraysJohan Tibell2014-06-302-0/+307
| | | | | | | | | | | | | | | | | | | | | | | This is the second attempt to add this functionality. The first attempt was reverted in 950fcae46a82569e7cd1fba1637a23b419e00ecd, due to register allocator failure on x86. Given how the register allocator currently works, we don't have enough registers on x86 to support cmpxchg using complicated addressing modes. Instead we fall back to a simpler addressing mode on x86. Adds the following primops: * atomicReadIntArray# * atomicWriteIntArray# * fetchSubIntArray# * fetchOrIntArray# * fetchXorIntArray# * fetchAndIntArray# Makes these pre-existing out-of-line primops inline: * fetchAddIntArray# * casIntArray#
* Eliminate `Unify.validKindShape` (#9242)Iavor S. Diatchki2014-06-291-5/+1
|